Skip to content

Commit

Permalink
Add job for building and publishing Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
barthalion committed Dec 16, 2022
1 parent 666ea5f commit fabb5fb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
39 changes: 38 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,41 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
args: -- -D warnings

docker:
name: Build Docker image
runs-on: ubuntu-latest
concurrency:
group: docker
cancel-in-progress: true
if: success()
steps:
- uses: actions/checkout@v3

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

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

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: ${{ github.ref == 'refs/heads/master' }}
tags: |
ghcr.io/flatpak/flat-manager:${{ github.sha }}
ghcr.io/flatpak/flat-manager:latest
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=ssh://[email protected]:${{ github.repository }}.git
org.opencontainers.image.url=https://github.com/${{ github.repository }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit fabb5fb

Please sign in to comment.