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: Docker release | |
'on': | |
release: | |
types: [published] | |
jobs: | |
hello: | |
name: Hello world | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Hello world!" | |
- run: echo "The event that triggered this action was a ${{ github.event_name }} event, ref is ${{ github.ref }}." | |
release-squareone: | |
name: Release Squareone image | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/squareone') | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Get version | |
id: version | |
run: | | |
echo "version=$(node -e "console.log(require('./apps/squareone/package.json').version);")" >> "$GITHUB_ENV" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: '.' | |
file: 'apps/squareone/Dockerfile' | |
push: true | |
tags: | | |
ghcr.io/lsst-sqre/squareone:${{ env.version }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |