diff --git a/.github/workflows/deploy.yml b/.github/workflows/latest.yml similarity index 88% rename from .github/workflows/deploy.yml rename to .github/workflows/latest.yml index 10edd3c..a79ebcf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/latest.yml @@ -1,4 +1,4 @@ -name: Deploy +name: Latest on: push: @@ -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 @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f7e1351 --- /dev/null +++ b/.github/workflows/release.yml @@ -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