Skip to content

0.3.0

0.3.0 #22

Workflow file for this run

name: Build and Push Docker
on:
release:
types:
- created
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
OWNER=$(echo ${{github.repository_owner}} | tr '[A-Z]' '[a-z]')
TAG="${{github.event.release.name}}"
docker build . --target workers --tag ghcr.io/$OWNER/hoarder-workers:$TAG -f docker/Dockerfile
docker build . --target web --tag ghcr.io/$OWNER/hoarder-web:$TAG -f docker/Dockerfile
- name: Log in to registry
# This is where you will update the PAT to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
OWNER=$(echo ${{github.repository_owner}} | tr '[A-Z]' '[a-z]')
TAG="${{github.event.release.name}}"
docker tag ghcr.io/$OWNER/hoarder-workers:$TAG ghcr.io/$OWNER/hoarder-workers:latest
docker tag ghcr.io/$OWNER/hoarder-web:$TAG ghcr.io/$OWNER/hoarder-web:latest
docker push ghcr.io/$OWNER/hoarder-workers:$TAG
docker push ghcr.io/$OWNER/hoarder-web:$TAG
docker push ghcr.io/$OWNER/hoarder-workers:latest
docker push ghcr.io/$OWNER/hoarder-web:latest