更新go版本为1.19 #14
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 Docker Image | |
on: | |
push: | |
pull_request: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: use nodejs | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: Node Modules Cache | |
id: npm-cache | |
uses: actions/cache@v3 | |
with: | |
path: ./file-online-manager-web/node_modules | |
key: node_modules-cache-${{ hashFiles('**/package.json') }} | |
restore-keys: node_modules-cache- | |
- name: build-vue | |
run: | | |
cd file-online-manager-web | |
npm install | |
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: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push latest | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
flowerbirds/file-manage:latest | |
ghcr.io/flowerbirds/file-manage:latest | |
- name: Set branch name | |
id: branch_name | |
run: echo "::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/})" | |
- name: Build and push branch | |
if: ${{ github.ref != 'refs/heads/master' }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
flowerbirds/file-manage:${{ steps.branch_name.outputs.branch }} | |
ghcr.io/flowerbirds/file-manage:${{ steps.branch_name.outputs.branch }} |