Skip to content

init

init #1

Workflow file for this run

name: production
on:
push:
branches:
- "master"
env:
REGISTRY: us-docker.pkg.dev/xxcloud/app/app-backup
IMAGE: prod
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
GKE_PROJECT: ${{ secrets.GKE_PROJECT }}
GKE_ZONE: ${{ secrets.GKE_ZONE }}
GKE_SA_KEY: ${{ secrets.GKE_SA_KEY }}
jobs:
fastdfs-backup:
name: deploy
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildxbe-cache
key: ${{ runner.os }}-buildxbe-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildxbe-
- name: Login to GCR
uses: docker/login-action@v1
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GKE_SA_KEY }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./fasdfs-backup.Dockerfile
push: true
tags: ${{ env.REGISTRY }}:${{ env.IMAGE }},${{ env.REGISTRY }}:latest
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildxbe-cache
cache-to: type=local,dest=/tmp/.buildxbe-cache-new,mode=max
build-args: |
GITHUB_SHA=${{ github.sha }}
GITHUB_REF=${{ github.ref }}
- name: Move cache
run: |
rm -rf /tmp/.buildxbe-cache
mv /tmp/.buildxbe-cache-new /tmp/.buildxbe-cache