feat(landing-page/ecoboost): update gif #503
Workflow file for this run
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
# build and push docker image to docker hub | |
name: Build & Deploy | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*" | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
IMAGE_NAME: flosspicks/crossbell-io | |
REGION_ID: us-east-1 | |
DEV_ACK_CLUSTER_ID: cd1d0ffc40b5242b39ddda1864e71e30d | |
PROD_ACK_CLUSTER_ID: cfc647c22fd6848b5a602ad4d7470632b | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.meta.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
tags: | | |
type=sha | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "pnpm" | |
- run: pnpm fetch && pnpm install -r --offline | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
deploy-dev: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set K8s context | |
uses: aliyun/ack-set-context@v1 | |
with: | |
access-key-id: "${{ secrets.ACCESS_KEY_ID }}" | |
access-key-secret: "${{ secrets.ACCESS_KEY_SECRET }}" | |
cluster-id: "${{ env.DEV_ACK_CLUSTER_ID }}" | |
- run: | | |
wget https://github.com/mikefarah/yq/releases/download/v4.25.1/yq_linux_amd64.tar.gz -O - | tar xz && mv yq_linux_amd64 /usr/local/bin/yq | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.10/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/kubectl | |
- env: | |
IMAGE_TAG_RELEASE: ${{ env.IMAGE_NAME }}:${{ needs.build.outputs.version }} | |
run: | | |
sh apply.sh deploy/dev/* | |
deploy-prod: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set K8s context | |
uses: aliyun/ack-set-context@v1 | |
with: | |
access-key-id: "${{ secrets.ACCESS_KEY_ID }}" | |
access-key-secret: "${{ secrets.ACCESS_KEY_SECRET }}" | |
cluster-id: "${{ env.PROD_ACK_CLUSTER_ID }}" | |
- run: | | |
wget https://github.com/mikefarah/yq/releases/download/v4.25.1/yq_linux_amd64.tar.gz -O - | tar xz && mv yq_linux_amd64 /usr/local/bin/yq | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.10/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/kubectl | |
- env: | |
IMAGE_TAG_RELEASE: ${{ env.IMAGE_NAME }}:${{ needs.build.outputs.version }} | |
run: | | |
sh apply.sh deploy/prod/* |