Remove unnecessary function update #55
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: Build Dev | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- dev | |
- mns | |
jobs: | |
build: | |
environment: staging | |
concurrency: | |
group: build-dev-${{ github.ref }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 7 | |
- name: Login to Docker | |
uses: docker/login-action@v2 | |
with: | |
registry: registry.ap-southeast-1.aliyuncs.com | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build docker image and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: . | |
tags: registry.ap-southeast-1.aliyuncs.com/kemono/image-optimizer:${{ github.ref_name }}-${{ env.SHA }} | |
file: Dockerfile | |
deploy: | |
environment: staging | |
concurrency: | |
group: deploy-${{ github.ref }} | |
cancel-in-progress: false | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 7 | |
- name: Install fcli | |
run: | | |
curl -o fcli.zip https://gosspublic.alicdn.com/fcli/fcli-v1.0.4-linux-amd64.zip | |
unzip fcli.zip | |
sudo mv fcli /usr/local/bin/ | |
- name: Update image version | |
env: | |
ALIBABA_CLOUD_ACCESS_KEY_ID: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} | |
ALIBABA_CLOUD_ACCESS_KEY_SECRET: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} | |
ALIBABA_CLOUD_DEFAULT_REGION: ap-southeast-1 | |
ALIBABA_CLOUD_ACCOUNT_ID: ${{ secrets.ALIYUN_ACCOUNT_ID }} | |
SHA: ${{ env.SHA }} | |
run: | | |
fcli function update -f img-opti -s kemono-staging -g registry.ap-southeast-1.aliyuncs.com/kemono/image-optimizer:$GITHUB_REF_NAME-$SHA | |
- name: Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_USERNAME: 'GitHub Actions' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_MESSAGE: 'image-optimizer-staging 已部署' |