chore(github-actions): fix syntax error #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: Pipeline | |
on: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- "**" | |
jobs: | |
pack: | |
if: ${{ !contains(github.event.head_commit.message, 'chore(docs)') && !contains(github.event.head_commit.message, '[deploy]') }} | |
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: Get Short Sha | |
id: shortSha | |
uses: benjlevesque/[email protected] | |
- 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: ${{ !contains(github.event.head_commit.message, '[deploy]') }} | |
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 }}_${{ needs.pack.outputs.shortSha }} | |
aysnine/assistant-she:latest | |
- run: | | |
TAG=${{ needs.pack.outputs.tag }}_${{ needs.pack.outputs.shortSha }} | |
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 |