Skip to content

chore(github-actions): condition release job #15

chore(github-actions): condition release job

chore(github-actions): condition release job #15

Workflow file for this run

name: Pipeline
on:
push:
branches:
- main
tags-ignore:
- "**"
jobs:
pack:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.previousTag.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 20
cache: "yarn"
- uses: browser-actions/setup-chrome@v1
id: setup-chrome
- run: |
yarn install
yarn build
echo "${{ secrets.PACK_KEY }}" > ./dist.pem
${{ steps.setup-chrome.outputs.chrome-path }} --pack-extension=./dist --pack-extension-key=./dist.pem
- name: Get Previous tag
id: previousTag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.0.0
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: pack
path: |
dist/
dist.crx
if-no-files-found: error
retention-days: 1
deploy:
if: ${{ contains(github.event.head_commit.message, '[deploy]') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Previous tag
id: previousTag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.0.0
- run: |
TAG=${{ steps.previousTag.outputs.tag }}
echo $TAG
sed -i -e "s/\:latest/\:${TAG}/g" ./deploy/cls-softfunny.yaml
cat ./deploy/cls-softfunny.yaml
- uses: actions-hub/[email protected]
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -f ./deploy/cls-softfunny.yaml
release:
needs: pack
if: ${{ startsWith(github.event.head_commit.message, 'chore(release)') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: pack
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub Private Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
aysnine/assistant-she:${{ needs.pack.outputs.tag }}
aysnine/assistant-she:latest
- run: |
TAG=${{ needs.pack.outputs.tag }}
echo $TAG
sed -i -e "s/\:latest/\:${TAG}/g" ./deploy/cls-softfunny.yaml
cat ./deploy/cls-softfunny.yaml
- uses: actions-hub/[email protected]
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -f ./deploy/cls-softfunny.yaml