Skip to content

Commit

Permalink
build image action
Browse files Browse the repository at this point in the history
  • Loading branch information
BrittleFoot committed Jan 27, 2024
1 parent 5957442 commit 3e2df41
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,41 @@ jobs:
env:
DATABASE_URL: postgres://postgres:@localhost:5432/postgres
run: make test

docker:
needs: build
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version-file: '.python-version'

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: login to ghcr
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}/app:latest
ghcr.io/${{ github.repository }}/${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 3e2df41

Please sign in to comment.