aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/docker.yaml
blob: 68a1ad5c85673c296862a563f03a19c4022f982b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: build-docker

on:
  push:
    branches: [main]

jobs:
  publish:
    concurrency:
      group: ${{ github.ref }}-docker
      cancel-in-progress: true
    permissions:
      packages: write

    runs-on: depot-ubuntu-24.04
    steps:
      - uses: actions/checkout@v6

      - name: Get Repo Owner
        id: get_repo_owner
        run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV

      - uses: depot/setup-action@v1

      - name: Login to container Registry
        uses: docker/login-action@v3
        with:
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GITHUB_TOKEN }}
          registry: ghcr.io

      - name: Get short sha
        id: shortsha
        run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

      - name: Build and push
        uses: depot/build-push-action@v1
        with:
          push: true
          platforms: linux/amd64,linux/arm64
          file: ./Dockerfile
          context: .
          provenance: false
          build-args: |
            Version=dev
            GitCommit=${{ steps.shortsha.outputs.short_sha }}
          tags: |
            ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}