Skip to content

Commit

Permalink
add build step for GHCR dev images, use GH Actions cache
Browse files Browse the repository at this point in the history
  • Loading branch information
detjensrobert committed Jul 18, 2023
1 parent 3ed5e5e commit a3826e5
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ jobs:
GCLOUD_VERSION=${{ env.GCLOUD_VERSION }}
KOMPOSE_VERSION=${{ env.KOMPOSE_VERSION }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha

publish_dockerhub_server:
needs: test
Expand Down Expand Up @@ -174,6 +176,8 @@ jobs:
file: ./docker/Dockerfile.server
push: true
tags: ${{ steps.meta_server.outputs.tags }}
cache-from: type=gha
cache-to: type=gha

publish_dockerhub_podman:
needs: publish_dockerhub
Expand Down Expand Up @@ -224,6 +228,8 @@ jobs:
KOMPOSE_VERSION=${{ env.KOMPOSE_VERSION }}
UNFURL_TAG=${{ steps.get_tag_name.outputs.tag }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha

publish_pypi:
needs: publish_dockerhub
Expand Down Expand Up @@ -272,3 +278,48 @@ jobs:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}

publish_dev_ghcr:
runs-on: ubuntu-latest
steps:
- name: Fetch repo
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Log in to registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/onecommons/unfurl
# commit sha, branch name, tag name, latest on main
tags: |
type=sha
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: ./
file: ./docker/Dockerfile
push: true
build-args: |
HELM_VERSION=${{ env.HELM_VERSION }}
TERRAFORM_VERSION=${{ env.TERRAFORM_VERSION }}
GCLOUD_VERSION=${{ env.GCLOUD_VERSION }}
KOMPOSE_VERSION=${{ env.KOMPOSE_VERSION }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha

0 comments on commit a3826e5

Please sign in to comment.