fix: deploy-insiders to login to private registry after docker install #22
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: insiders-build | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.changes.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
version: | |
- 'apps/api/karrio/server/VERSION' | |
insiders-server-build: | |
needs: changes | |
if: ${{ needs.changes.outputs.version == 'true' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
token: ${{ secrets.GH_PAT }} | |
- id: get_tag | |
run: | | |
cat ./apps/api/karrio/server/VERSION | |
echo "tag=$(cat ./apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV" | |
- name: Build insider server image | |
run: | | |
echo 'Build and push karrio-insiders server:${{ env.tag }}...' | |
echo ${{ secrets.GH_PAT }} | docker login ghcr.io -u USERNAME --password-stdin | |
./bin/build-insiders-image ${{ env.tag }} && | |
docker push ghcr.io/karrioapi/server:${{ env.tag }} || exit 1 | |
insiders-dashboard-build: | |
needs: changes | |
if: ${{ needs.changes.outputs.version == 'true' || github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
token: ${{ secrets.GH_PAT }} | |
- id: get_tag | |
run: | | |
cat ./apps/api/karrio/server/VERSION | |
echo "tag=$(cat ./apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV" | |
- name: Build insider dashboard image | |
run: | | |
echo 'Build and push karrio-insiders dashboard:${{ env.tag }}...' | |
echo ${{ secrets.GH_PAT }} | docker login ghcr.io -u USERNAME --password-stdin | |
KARRIO_IMAGE=ghcr.io/karrioapi/dashboard ./bin/build-dashboard-image ${{ env.tag }} && | |
docker push ghcr.io/karrioapi/dashboard:${{ env.tag }} || exit 1 |