-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
21 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Docker image | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
buildx: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Variables | ||
id: variables | ||
run: | | ||
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} | ||
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} | ||
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} | ||
echo ::set-output name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}') | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: crazy-max/ghaction-docker-buildx@v2 | ||
with: | ||
buildx-version: latest | ||
skip-cache: false | ||
qemu-version: latest | ||
|
||
- name: Available platforms | ||
run: echo ${{ steps.buildx.outputs.platforms }} | ||
|
||
- name: Login to DockerHub | ||
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
|
||
- name: Build and push tag | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 \ | ||
-t a00s/${{ steps.variables.outputs.REPOSITORY_NAME }}:${{ steps.variables.outputs.SOURCE_TAG }} \ | ||
. \ | ||
--push | ||
- name: Build and push latest | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 \ | ||
-t a00s/${{ steps.variables.outputs.REPOSITORY_NAME }}:latest \ | ||
. \ | ||
--push |
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