Skip to content

Commit

Permalink
split worklows
Browse files Browse the repository at this point in the history
  • Loading branch information
a0s committed Aug 23, 2020
1 parent 80f4760 commit a7af010
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Image for Docker Hub
name: Binary release
on:
release:
types: [published]
Expand Down Expand Up @@ -28,25 +28,6 @@ jobs:
- 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
- name: Build and upload binaries to release
run: |
mkdir build
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/build-image.yml
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- master
paths:
- README.md
- .github/workflows/dockerhub-description.yml
- .github/workflows/update-description.yml
jobs:
dockerHubDescription:
runs-on: ubuntu-latest
Expand Down

0 comments on commit a7af010

Please sign in to comment.