Workflow file for this run
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: Build docker image | |
on: push | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '10.x' | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Build | |
run: npm ci && npm run generate && cd api && npm ci && npm run generate | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate image tag | |
run: echo '::set-output name=IMAGE_TAG::'$(echo ${{ github.sha }} | cut -c1-8) | |
id: tag-generator | |
- name: Build and push Docker images | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/${{ github.repository }}:${{ steps.tag-generator.outputs.IMAGE_TAG }} | |
- name: Create tag | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/build-${{ steps.tag-generator.outputs.IMAGE_TAG }}', | |
sha: context.sha | |
}) |