Skip to content

docker: Add a docker-based dev environment #13

docker: Add a docker-based dev environment

docker: Add a docker-based dev environment #13

Workflow file for this run

name: Build and Push Docker
on:
push:
branches:
- main
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
docker build . --target workers --tag hoarder-workers -f docker/Dockerfile
docker build . --target web --tag hoarder-web -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]')
docker tag hoarder-workers ghcr.io/$OWNER/hoarder-workers:latest
docker tag hoarder-web ghcr.io/$OWNER/hoarder-web:latest
docker push ghcr.io/$OWNER/hoarder-workers:latest
docker push ghcr.io/$OWNER/hoarder-web:latest