CI: build and push frontend image to GHCR as meteorpointer-fe #6
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| jobs: | |
| image: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Docker metadata (tags + labels) | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/bolidozor/meteorpointer-api | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push API image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/api/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Docker metadata for FE (tags + labels) | |
| id: meta-fe | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/bolidozor/meteorpointer-fe | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha | |
| - name: Build and push FE image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/fe/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta-fe.outputs.tags }} | |
| labels: ${{ steps.meta-fe.outputs.labels }} |