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 5b36dcb commit 3cfb20a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,40 @@ 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 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/main' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: string
uses: ASzc/change-string-case-action@v5
with:
string: ghcr.io/${{ github.repository }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ steps.string.outputs.lowercase }}
${{ steps.string.outputs.lowercase }}/${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ADD requirements.txt /srv
RUN pip install --no-cache-dir -r /srv/requirements.txt

ADD src /srv
RUN rm /srv/.env
RUN rm -f /srv/.env
WORKDIR /srv


Expand Down

0 comments on commit 3cfb20a

Please sign in to comment.