Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Dec 15, 2023
1 parent 74ff107 commit fb550d9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml → .github/workflows/latest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: Latest

on:
push:
Expand All @@ -9,11 +9,12 @@ on:

jobs:
publish:
name: Build and Publish Docker image
runs-on: [ arc-runner-set ]

env:
GAR_REGISTRY: us-east1-docker.pkg.dev
GAR_IMAGE: zap-strike-infrastructure/zap-container-registry/lnd-mempoolspace

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4

Expand All @@ -32,7 +33,6 @@ jobs:
with:
context: .
push: true
tags: |
${{ env.GAR_REGISTRY }}/${{ env.GAR_IMAGE }}:latest
tags: ${{ env.GAR_REGISTRY }}/${{ env.GAR_IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
release:
types: [ "published" ]

jobs:
docker:
runs-on: "ubuntu-latest"

env:
GAR_REGISTRY: us-east1-docker.pkg.dev
GAR_IMAGE: zap-strike-infrastructure/zap-container-registry/lnd-mempoolspace
DOCKERHUB_IMAGE: lnzap/lnd-mempoolspace

steps:
- name: Checkout Code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3

- name: Set version
run: echo "VERSION=$(echo ${{ github.ref }} | awk -F 'v' '{print $2}')" >> $GITHUB_ENV

- name: 'Setup Google Artifact Registry'
uses: LN-Zap/zap-github-actions/.github/actions/setup-google-artifact-registry@master
with:
registry: us-east1-docker.pkg.dev
credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_ARTIFACT_REGISTRY }}

- name: Dockerhub login
run: "docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}"

- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # pin@v2
- uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # pin@v2
- uses: docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 # pin@v3
with:
push: true
tags: |
${{ env.GAR_REGISTRY }}/${{ env.GAR_IMAGE }}:${{ env.VERSION }}
${{ env.DOCKERHUB_IMAGE }}:latest
${{ env.DOCKERHUB_IMAGE }}:${{ env.VERSION }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=min

0 comments on commit fb550d9

Please sign in to comment.