Skip to content

Commit

Permalink
ci: Ensure release-please triggers docker/build-push-action jobs (#443)
Browse files Browse the repository at this point in the history
* This wasn't automatic up to now because these jobs were in a separate
  workflow and the tagging or release events that occur in release.yml
  cannot trigger children workflows from a mere `secrets.GITHUB_TOKEN`

* href: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
  • Loading branch information
erikmd committed Oct 13, 2021
1 parent 7c11083 commit 71c3590
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 71 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/deploy-tags.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -120,3 +120,68 @@ jobs:
- name: Publish to opam
run: |
./scripts/opam-publish.exp "${{ needs.release-please.outputs.tag_name }}" "$opam_repo" "$source_repo"
# Note: you may want to update the jobs below and deploy-master.yml at once
push_server:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
name: Push learn-ocaml image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Get tag name
run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "::set-output name=tag::${tag#v}"
id: tag
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
always_pull: true
add_git_labels: true
labels: "org.opencontainers.image.version=${{ steps.tag.outputs.tag }}"
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ocamlsf/learn-ocaml
tags: "latest,${{ steps.tag.outputs.tag }}"
push_client:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
name: Push learn-ocaml-client image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Get tag name
run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "::set-output name=tag::${tag#v}"
id: tag
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
always_pull: true
add_git_labels: true
labels: "org.opencontainers.image.version=${{ steps.tag.outputs.tag }}"
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ocamlsf/learn-ocaml-client
target: client
tags: "latest,${{ steps.tag.outputs.tag }}"
push_emacs_client:
needs:
- release-please
- push_client
if: ${{ needs.release-please.outputs.release_created }}
name: Push emacs-learn-ocaml-client image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Get tag name
run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "::set-output name=tag::${tag#v}"
id: tag
- name: Push to Docker Hub
# https://github.com/docker/build-push-action/tree/releases/v1#readme
uses: docker/build-push-action@v1
with:
path: ci/docker-emacs-learn-ocaml-client
build_args: "base=ocamlsf/learn-ocaml-client,version=${{ steps.tag.outputs.tag }}"
always_pull: true
add_git_labels: true
labels: "org.opencontainers.image.version=${{ steps.tag.outputs.tag }}"
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ocamlsf/emacs-learn-ocaml-client
tags: ${{ steps.tag.outputs.tag }}

0 comments on commit 71c3590

Please sign in to comment.