diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c917fed --- /dev/null +++ b/.github/workflows/build.yml @@ -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 . diff --git a/.github/workflows/buildx-latest.yml b/.github/workflows/buildx-latest.yml new file mode 100644 index 0000000..5180e69 --- /dev/null +++ b/.github/workflows/buildx-latest.yml @@ -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 diff --git a/.github/workflows/buildx-release.yml b/.github/workflows/buildx-release.yml new file mode 100644 index 0000000..7b22f44 --- /dev/null +++ b/.github/workflows/buildx-release.yml @@ -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 diff --git a/hooks/build b/hooks/build deleted file mode 100644 index 8e98dbe..0000000 --- a/hooks/build +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ - --build-arg VCS_REF=`git rev-parse --short HEAD` \ - -t $IMAGE_NAME . diff --git a/hooks/post_build b/hooks/post_build deleted file mode 100644 index 37d2eab..0000000 --- a/hooks/post_build +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -curl -X POST https://hooks.microbadger.com/images/qmcgaw/cod4/8mWxKyC34UYWUF7BRtDpbB8WWt4= \ No newline at end of file