Skip to content

Commit

Permalink
Merge pull request #10 from cyber-dojo/update-after-switch-to-single-…
Browse files Browse the repository at this point in the history
…workflow

Update after switch to single workflow
  • Loading branch information
JonJagger committed Mar 23, 2024
2 parents 37f5d77 + d1a1018 commit 34165c4
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/main.yml
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Begin Kosli Trail
run:
kosli begin trail "${{ env.KOSLI_TRAIL }}"
--description="${{ github.actor }} - ${{ github.event.head_commit.message }}"
--description="$(git log -1 --pretty='%aN - %s')"

- name: Set outputs
id: variables
Expand Down Expand Up @@ -272,3 +272,30 @@ jobs:
IMAGE_TAG: ${{ needs.kosli-trail.outputs.image_tag }}
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}


# The cyberdojo/versioner refresh-env.sh script
# https://github.com/cyber-dojo/versioner/blob/master/sh/refresh-env.sh
# relies on being able to:
# - get the :latest image
# - extract the SHA env-var embedded inside it
# - use the 1st 7 chars of the SHA as a latest-equivalent tag

push-latest:
needs: [deploy-to-prod, kosli-trail]
runs-on: ubuntu-latest
env:
IMAGE_NAME: ${{ needs.kosli-trail.outputs.image_name }}
steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}

- name: Tag image to :latest and push to Dockerhub Registry
run: |
docker pull "${IMAGE_NAME}"
docker tag "${IMAGE_NAME}" cyberdojo/${{ env.SERVICE_NAME }}:latest
docker push cyberdojo/${{ env.SERVICE_NAME }}:latest

0 comments on commit 34165c4

Please sign in to comment.