ci: add manual trigger #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
# Run on pushes to master | |
push: | |
branches: | |
- master | |
# Run on manual trigger | |
workflow_dispatch: | |
# Run on pull requests (automatically uses PR in docker name) | |
pull_request: | |
# trigger a cron job every monday at 6am | |
schedule: | |
- cron: '00 06 * * MON' | |
jobs: | |
# Push image to GitHub Packages. | |
# See also https://docs.docker.com/docker-hub/builds/ | |
# Two identical jobs to create both a 64bit and 128bit security docker image | |
push-image: | |
name: Push Docker image ${{ matrix.core }}-${{ matrix.security }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
core: [sancus, aion] | |
security: [64, 128] | |
include: | |
- security: 64 | |
key: deadbeefcafebabe | |
- security: 128 | |
key: deadbeefcafebabec0defeeddefec8ed | |
steps: | |
# Check out repository | |
- uses: actions/checkout@v2 | |
# Retrieves the name of the docker image we want to use | |
- id: docker-name | |
name: Generate Docker name | |
uses: ./.github/workflows/scripts/docker-image-name/ | |
with: | |
security: ${{ matrix.security }} | |
core: ${{ matrix.core }} | |
- name: Build Sancus Security | |
run: cd docker && docker build -t ${{ steps.docker-name.outputs.image-name }} --build-arg BUILD_BRANCH=master --build-arg BUILD_SECURITY=${{ matrix.security }} --build-arg BUILD_KEY=${{ matrix.key }} --build-arg BUILD_ATOMICITY=${{ matrix.core == 'aion' }} . | |
- name: Log into registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin | |
- name: Push image | |
run: | | |
docker tag ${{ steps.docker-name.outputs.image-name }} ${{ steps.docker-name.outputs.image-id }}:${{ steps.docker-name.outputs.image-version }} | |
docker push ${{ steps.docker-name.outputs.image-id }}:${{ steps.docker-name.outputs.image-version }} |