mirror of
https://github.com/alexandrev/xslt-lab.git
synced 2026-09-20 04:23:16 +00:00
Add helm chart publishing workflow
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
name: Publish Docker images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push backend image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./backend
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository_owner }}/xslt-playground-backend:latest
|
||||
|
||||
- name: Make backend image public
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
PACKAGE: xslt-playground-backend
|
||||
run: |
|
||||
echo "$GH_TOKEN" | gh auth login --with-token
|
||||
if gh api orgs/$OWNER > /dev/null 2>&1; then
|
||||
gh api -X PATCH /orgs/$OWNER/packages/container/$PACKAGE --field visibility=public
|
||||
else
|
||||
gh api -X PATCH /user/packages/container/$PACKAGE --field visibility=public
|
||||
fi
|
||||
|
||||
- name: Build and push frontend image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./frontend
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository_owner }}/xslt-playground-frontend:latest
|
||||
|
||||
- name: Make frontend image public
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
PACKAGE: xslt-playground-frontend
|
||||
run: |
|
||||
echo "$GH_TOKEN" | gh auth login --with-token
|
||||
if gh api orgs/$OWNER > /dev/null 2>&1; then
|
||||
gh api -X PATCH /orgs/$OWNER/packages/container/$PACKAGE --field visibility=public
|
||||
else
|
||||
gh api -X PATCH /user/packages/container/$PACKAGE --field visibility=public
|
||||
fi
|
||||
Reference in New Issue
Block a user