ci: ensure to checkout repo as the jobs first step #24
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: publish to docker hub | |
on: [push, workflow_dispatch] | |
jobs: | |
get_version: | |
name: Clone and get version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get version | |
shell: bash | |
id: release | |
run: echo "VERSION=$(node -e "console.log(require('./lerna.json').version)")" >> $GITHUB_OUTPUT | |
outputs: | |
version: ${{ steps.release.outputs.VERSION }} | |
publish_apiserver: | |
name: Publish Goodtok API Server | |
runs-on: ubuntu-latest | |
needs: [get_version] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Publish to Docker Hub | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: fonoster/goodtok-apiserver | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
context: . | |
dockerfile: mods/apiserver/Dockerfile | |
tags: "latest,${{ needs.get_version.outputs.VERSION }}" |