fix custom secrets parsing #147
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- 'feat-**' | |
paths-ignore: | |
- 'charts/**' | |
jobs: | |
buildAndDeploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout & Build | |
uses: actions/checkout@v4 | |
- name: Build | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
cache-dependency-path: package-lock.json | |
- run: npm ci && npm run build | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get Version | |
id: package-version | |
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
- name: Build and push Docker Image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: true | |
tags: >- | |
${{ | |
github.ref == 'refs/heads/main' && format('gravitycloud/gravity-ci-cd-agent:latest,gravitycloud/gravity-ci-cd-agent:{0}', steps.package-version.outputs.VERSION) || | |
github.ref == 'refs/heads/develop' && 'gravitycloud/gravity-ci-cd-agent:dev' || | |
format('gravitycloud/gravity-ci-cd-agent:{0}', github.ref_name) | |
}} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Send Slack Notification | |
if: success() | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"text": "✅ Successfully deployed ${{ github.repository }} to Docker Hub\nBranch: ${{ github.ref_name }}\nTags: ${{ | |
github.ref == 'refs/heads/main' && format('latest, {0}', steps.package-version.outputs.VERSION) || | |
github.ref == 'refs/heads/develop' && 'dev' || | |
github.ref_name | |
}}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |