deploy/added running test step to pipeline #3
This file contains hidden or 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
| name: Lab 2 Container Registry | ||
|
Check failure on line 1 in .github/workflows/pipeline.yml
|
||
| on: [push] | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Extract metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository_owner }}/ecommerce-app | ||
| tags: | | ||
| type=raw,value=latest | ||
| type=sha,prefix=sha-,format=short | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ./back | ||
| push: true | ||
| tags: ${{ id.meta.outputs.tags }} | ||
| labels: ${{ id.meta.outputs.labels }} | ||
| - name: Run Master Validation Script | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| chmod +x ./tests/lab2_test.sh | ||
| ./tests/lab2_test.sh | ||