Fix actions file again lol #1
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
name: Docker Image CI | |
on: | |
push: | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
deploy: | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
runs-on: ubuntu-latest | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Login to Github Packages | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata for Docker | |
id: meta_web | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web | |
tags: | | |
# set latest tag for default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Extract metadata for Docker | |
id: meta_worker | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-worker | |
tags: | | |
# set latest tag for default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Build and push | |
id: push_web | |
uses: docker/build-push-action@v3 | |
with: | |
context: '.' | |
file: 'web.Dockerfile' | |
push: true | |
pull: true | |
tags: ${{ steps.meta_web.outputs.tags }} | |
labels: ${{ steps.meta_web.outputs.labels }} | |
- name: Build and push | |
id: push_worker | |
uses: docker/build-push-action@v3 | |
with: | |
context: '.' | |
file: 'worker.Dockerfile' | |
push: true | |
pull: true | |
tags: ${{ steps.meta_worker.outputs.tags }} | |
labels: ${{ steps.meta_worker.outputs.labels }} |