|
|
|
@ -45,20 +45,15 @@ jobs:
|
|
|
|
uses: robherley/go-test-action@v0
|
|
|
|
uses: robherley/go-test-action@v0
|
|
|
|
|
|
|
|
|
|
|
|
push_to_registry:
|
|
|
|
push_to_registry:
|
|
|
|
name: Push Docker image to Docker Hub
|
|
|
|
name: Push Docker image to Docker Hub (release)
|
|
|
|
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
needs: test
|
|
|
|
needs: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
attestations: write
|
|
|
|
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
@ -66,19 +61,12 @@ jobs:
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
|
|
|
|
id: meta
|
|
|
|
|
|
|
|
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
images: gabehf/koito
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Extract tag version
|
|
|
|
- name: Extract tag version
|
|
|
|
id: extract_version
|
|
|
|
|
|
|
|
run: echo "KOITO_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
run: echo "KOITO_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
|
|
|
|
- name: Build and push Docker image
|
|
|
|
- name: Build and push release image
|
|
|
|
id: push
|
|
|
|
id: push
|
|
|
|
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
file: ./Dockerfile
|
|
|
|
@ -90,24 +78,16 @@ jobs:
|
|
|
|
KOITO_VERSION=${{ env.KOITO_VERSION }}
|
|
|
|
KOITO_VERSION=${{ env.KOITO_VERSION }}
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
|
|
|
|
|
|
|
- name: Generate artifact attestation
|
|
|
|
|
|
|
|
uses: actions/attest-build-provenance@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
subject-name: index.docker.io/gabehf/koito
|
|
|
|
|
|
|
|
subject-digest: ${{ steps.push.outputs.digest }}
|
|
|
|
|
|
|
|
push-to-registry: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
push_dev:
|
|
|
|
push_dev:
|
|
|
|
name: Push Docker image (dev branch)
|
|
|
|
name: Push Docker image (dev branch)
|
|
|
|
if: github.ref == 'refs/heads/dev'
|
|
|
|
if: github.ref == 'refs/heads/dev'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: test
|
|
|
|
needs: test
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
|