Docker build with workflows instead of Travis CI
This commit is contained in:
43
.github/workflows/buildx-branch.yml
vendored
Normal file
43
.github/workflows/buildx-branch.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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 \
|
||||||
|
--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/private-internet-access:${GITHUB_REF##*/} \
|
||||||
|
--push \
|
||||||
|
.
|
||||||
|
- run: curl -X POST https://hooks.microbadger.com/images/qmcgaw/private-internet-access/tQFy7AxtSUNANPe6aoVChYdsI_I= || exit 0
|
||||||
55
.github/workflows/buildx-latest.yml
vendored
Normal file
55
.github/workflows/buildx-latest.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: Buildx latest
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
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
|
||||||
|
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,linux/arm64,linux/arm/v7,linux/arm/v6 \
|
||||||
|
--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/private-internet-access:latest \
|
||||||
|
--push \
|
||||||
|
.
|
||||||
|
- run: curl -X POST https://hooks.microbadger.com/images/qmcgaw/private-internet-access/tQFy7AxtSUNANPe6aoVChYdsI_I= || exit 0
|
||||||
40
.github/workflows/buildx-release.yml
vendored
Normal file
40
.github/workflows/buildx-release.yml
vendored
Normal file
@@ -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,linux/arm64,linux/arm/v7,linux/arm/v6 \
|
||||||
|
--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/private-internet-access:${GITHUB_REF##*/} \
|
||||||
|
--push \
|
||||||
|
.
|
||||||
|
- run: curl -X POST https://hooks.microbadger.com/images/qmcgaw/private-internet-access/tQFy7AxtSUNANPe6aoVChYdsI_I= || exit 0
|
||||||
20
.travis.yml
20
.travis.yml
@@ -1,20 +0,0 @@
|
|||||||
dist: xenial
|
|
||||||
sudo: required
|
|
||||||
git:
|
|
||||||
quiet: true
|
|
||||||
depth: 1
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- DOCKER_REPO=qmcgaw/private-internet-access
|
|
||||||
before_install:
|
|
||||||
- curl -fsSL https://get.docker.com | sh
|
|
||||||
- echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json
|
|
||||||
- mkdir -p $HOME/.docker
|
|
||||||
- echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json
|
|
||||||
- sudo service docker start
|
|
||||||
install:
|
|
||||||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
||||||
- docker buildx create --name xbuilder --use
|
|
||||||
script: bash ci.sh
|
|
||||||
after_success:
|
|
||||||
- curl -X POST https://hooks.microbadger.com/images/$DOCKER_REPO/tQFy7AxtSUNANPe6aoVChYdsI_I= || exit 0
|
|
||||||
35
ci.sh
35
ci.sh
@@ -1,35 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
ARCHS=linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x
|
|
||||||
|
|
||||||
echo -e "\n\nPull request: $TRAVIS_PULL_REQUEST\nRelease tag: $TRAVIS_TAG\nBranch: $TRAVIS_BRANCH\n\nTarget arch: $ARCHS\n\n"
|
|
||||||
|
|
||||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
|
||||||
echo -e "\n\nBuilding pull request without pushing to Docker Hub\n\n"
|
|
||||||
docker buildx build \
|
|
||||||
--progress plain \
|
|
||||||
--platform="$ARCHS" \
|
|
||||||
.
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $DOCKER_PASSWORD | docker login -u qmcgaw --password-stdin 2>&1
|
|
||||||
|
|
||||||
TAG="$TRAVIS_TAG"
|
|
||||||
if [ -z "$TAG" ]; then
|
|
||||||
TAG=latest
|
|
||||||
if [ "$TRAVIS_BRANCH" != "master" ]; then
|
|
||||||
TAG="$TRAVIS_BRANCH"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\n\nBuilding Docker images for \"$DOCKER_REPO:$TAG\"\n\n"
|
|
||||||
docker buildx build \
|
|
||||||
--progress plain \
|
|
||||||
--platform="$ARCHS" \
|
|
||||||
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
|
|
||||||
--build-arg VCS_REF=`git rev-parse --short HEAD` \
|
|
||||||
--build-arg VERSION=$TAG \
|
|
||||||
-t $DOCKER_REPO:$TAG \
|
|
||||||
--push \
|
|
||||||
.
|
|
||||||
Reference in New Issue
Block a user