Skip to content

Commit

Permalink
Github actions buildx instead of Dockerhub hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Apr 22, 2020
1 parent c71bb43 commit 3c66f6e
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 8 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Docker build
on:
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
run: docker build .
40 changes: 40 additions & 0 deletions .github/workflows/buildx-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Buildx latest
on:
push:
branches: [master]
paths-ignore:
- .github/workflows/buildx-release.yml
- .github/workflows/dockerhub-description.yml
- .github/workflows/greetings.yml
- .github/workflows/labels.yml
- .github/workflows/misspell.yml
- .github/workflows/security.yml
- .dockerignore
- .gitignore
- docker-compose.yml
- LICENSE
- README.md
- title.svg
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Buildx setup
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Dockerhub login
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u qmcgaw --password-stdin 2>&1
- name: Run Buildx
run: |
docker buildx build \
--progress plain \
--platform=linux/amd64,linux/386 \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION=latest \
-t qmcgaw/cod4:latest \
--push \
.
- run: curl -X POST https://hooks.microbadger.com/images/qmcgaw/cod4/8mWxKyC34UYWUF7BRtDpbB8WWt4= || exit 0
40 changes: 40 additions & 0 deletions .github/workflows/buildx-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Buildx release
on:
release:
types: [published]
paths-ignore:
- .github/workflows/buildx-latest.yml
- .github/workflows/dockerhub-description.yml
- .github/workflows/greetings.yml
- .github/workflows/labels.yml
- .github/workflows/misspell.yml
- .github/workflows/security.yml
- .dockerignore
- .gitignore
- docker-compose.yml
- LICENSE
- README.md
- title.svg
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Dockerhub login
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u qmcgaw --password-stdin 2>&1
- name: Run Buildx
run: |
docker buildx build \
--progress plain \
--platform=linux/amd64,linux/386 \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION=${GITHUB_REF##*/} \
-t qmcgaw/cod4:${GITHUB_REF##*/} \
--push \
.
- run: curl -X POST https://hooks.microbadger.com/images/qmcgaw/cod4/8mWxKyC34UYWUF7BRtDpbB8WWt4= || exit 0
5 changes: 0 additions & 5 deletions hooks/build

This file was deleted.

3 changes: 0 additions & 3 deletions hooks/post_build

This file was deleted.

0 comments on commit 3c66f6e

Please sign in to comment.