Skip to content

Update README.md

Update README.md #23

# This is a basic workflow to help you get started with Actions
name: official-docker
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- "*"
tags:
- 'v*.*.*'
pull_request:
branches:
- "*"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- run: |
env
echo "REPO_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
echo "COMMIT_SHORT=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
env
shell: bash
# - name: Build and push Docker images
# uses: docker/build-push-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# repository: ${{ secrets.DOCKER_ORGANIZATION }}/${GITHUB_REPOSITORY#*/}
# tag_with_ref: true
# tag_with_sha: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ${{ secrets.DOCKER_ORGANIZATION }}/fsync # list of Docker images to use as base name for tags
tag-sha: true # add git short SHA as Docker tag
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
secrets: |
GIT_AUTH_TOKEN=${{ secrets.MYTOKEN }}
tags: |
${{ steps.docker_meta.outputs.tags }}
build-args: |
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}