updated github workflow to include additional descriptive tags #2
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: Build SiteLogistix Sveltekit | |
| on: | |
| pull_request: | |
| branches: | |
| - production #replace with target branch | |
| types: | |
| - closed | |
| jobs: | |
| if_merged: | |
| if: github.event.pull_request.merged == true | |
| name: Build Sveltekit & Push | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: sveltekit/ | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| fetch-depth: 3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=latest | |
| type=raw,value=build-${{github.run_number}} | |
| type=raw,value=${{ github.ref_name }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| file: ./sveltekit/Dockerfile | |
| context: ./sveltekit | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # "PORT=${{ secrets.SV_PORT }}" | |
| # "CAPTCHAKEY=${{ secrets.CAPTCHAKEY }}" | |
| # "PB_URL=${{ secrets.PB_URL }}" |