Skip to content

Commit

Permalink
Merge pull request #62 from tmknight/develop
Browse files Browse the repository at this point in the history
Refine action workflows
  • Loading branch information
tmknight authored Jul 8, 2023
2 parents f07a77e + 15501e8 commit 2f48ffc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,12 @@ jobs:
run: |
echo "tag=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_ENV
echo "ver=org.opencontainers.image.version=latest" >> $GITHUB_ENV
## Set tag/label off schedule
- if: github.event_name != 'schedule'
name: Conditional(Set tag as called)
run: |
echo "tag=${{ steps.meta.outputs.tags }}" >> $GITHUB_ENV
echo "ver=org.opencontainers.image.version=" >> $GITHUB_ENV
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
- if: github.event_name == 'schedule'
name: Build and push Docker image on schedule
id: build-and-push-schedule
uses: docker/build-push-action@v4
with:
context: .
Expand All @@ -110,3 +104,18 @@ jobs:
${{ env.ver }}
cache-from: type=gha
cache-to: type=gha,mode=max

- if: github.event_name != 'schedule'
name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
file: ${{ env.IMAGE }}.dockerfile
build-args: ${{ env.BUILD_ARGS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
27 changes: 19 additions & 8 deletions .github/workflows/github-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,11 @@ jobs:
echo "tag=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_ENV
echo "ver=org.opencontainers.image.version=latest" >> $GITHUB_ENV
## Set tag/label off schedule
- if: github.event_name != 'schedule'
name: Conditional(Set tag as called)
run: |
echo "tag=${{ steps.meta.outputs.tags }}" >> $GITHUB_ENV
echo "ver=org.opencontainers.image.version=" >> $GITHUB_ENV
## Build and push Docker image with Buildx (don't push on PR)
## https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
- if: github.event_name == 'schedule'
name: Build and push Docker image on schedule
id: build-and-push-schedule
uses: docker/build-push-action@v4
with:
context: .
Expand All @@ -121,6 +116,22 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- if: github.event_name != 'schedule'
name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
file: ${{ env.IMAGE }}.dockerfile
build-args: ${{ env.BUILD_ARGS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Multi-arch NordVPN for Docker
cache-from: type=gha
cache-to: type=gha,mode=max

## Sign the resulting Docker image digest except on PRs.
## This will only write to the public Rekor transparency log when the Docker
## repository is public to avoid leaking data. If you would like to publish
Expand Down

0 comments on commit 2f48ffc

Please sign in to comment.