Build and Release Docker Images #30
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
name: Build and Release Docker Images | |
on: | |
push: | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build_and_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install jq | |
run: sudo apt-get install jq | |
- name: Download and install geckodriver | |
run: | | |
curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest \ | |
| jq -r \ | |
| grep "browser_download_url.*linux64.tar.gz" \ | |
| head -n 1 \ | |
| cut -d : -f 2,3 \ | |
| tr -d \" \ | |
| wget -qi - \ | |
&& tar -xzf geckodriver-v*-linux64.tar.gz \ | |
- name: Download and Extract MiSans Regular | |
run: | | |
wget https://cdn.cnbj1.fds.api.mi-img.com/vipmlmodel/font/MiSans/MiSans.zip \ | |
&& unzip MiSans.zip \ | |
&& mv MiSans\ 开发下载字重/MiSans-Regular.ttf ./ | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and Release Docker Images | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
${{ github.repository }}:latest | |
${{ github.repository }}:${{ github.ref_name }} | |
cache-from: type=registry,ref=${{ github.repository }}:latest | |
cache-to: type=inline,dest=${{ github.repository }}:latest |