Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

2.11.2

2.11.2 #230

name: Publish Docker images
on:
push:
tags:
- "v*"
jobs:
publish-docker-images:
name: Publish aimmo Docker images
# if: github.event.head_commit.author.email == 'action@github.com'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set docker tag
id: docker_tag
run: |
echo "::set-output name=tag::${GITHUB_REF:11}" # this is either branch name or tag after first character ('v')
- name: Build and push aimmo-game image
id: game
uses: docker/build-push-action@v3
with:
context: aimmo-game
file: aimmo-game/Dockerfile
tags: ocadotechnology/aimmo-game:${{ steps.docker_tag.outputs.tag }}
target: runner
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: |
echo ${{ steps.game.outputs.digest }}
echo ${{ steps.game_creator.outputs.digest }}
trigger-staging-deployment:
name: Trigger staging deployment
needs: [publish-docker-images]
runs-on: ubuntu-20.04
steps:
- name: Trigger staging deployment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.CFL_BOT_GITHUB_TOKEN }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'ocadotechnology',
repo: 'codeforlife-deploy-appengine',
workflow_id: 'deploy_staging.yml',
ref: 'master',
});