-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: CI/CD Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | ||
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} | ||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} | ||
DOCKER_CONTENT_TRUST: "0" | ||
DOCKER_CONTENT_TRUST_SERVER: "https://notary.artichokenetwork.com" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP with tools | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
tools: composer:v2 | ||
|
||
- name: Install Dependencies | ||
run: composer install | ||
|
||
- name: Copy .env.example to .env | ||
run: cp .env.example .env | ||
|
||
- name: Generate Laravel Key | ||
run: php artisan key:generate | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Build assets | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Run PHPUnit Tests | ||
run: vendor/bin/phpunit | ||
|
||
package: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Cosign | ||
uses: sigstore/[email protected] | ||
|
||
- name: Login to Docker Registry | ||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login harbor.artichokenetwork.com -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Build and Push Docker Image | ||
run: | | ||
docker build -t harbor.artichokenetwork.com/ferritecms/ferrite:latest . | ||
docker push harbor.artichokenetwork.com/ferritecms/ferrite:latest | ||
- name: Sign the Docker Image | ||
run: cosign sign --yes --key env://COSIGN_PRIVATE_KEY harbor.artichokenetwork.com/ferritecms/ferrite:latest | ||
|
||
|