forked from myoung34/docker-github-actions-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request myoung34#64 from damacus/base/update-workflow
Updates the base Dockerfile workflow to use Docker's GitHub Action
- Loading branch information
Showing
1 changed file
with
77 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,94 @@ | ||
name: GitHub Actions Runner in Docker - Base | ||
on: | ||
push: | ||
paths: | ||
- Dockerfile.base | ||
paths: [Dockerfile.base] | ||
branches: | ||
- master | ||
- develop | ||
schedule: | ||
- cron: '0 22 * * *' | ||
|
||
schedule: [cron: "0 22 * * *"] | ||
|
||
jobs: | ||
ubuntu_base_latest_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Copy Repo Files | ||
uses: actions/checkout@master | ||
- name: Get GitHub organization or user | ||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY}) | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: crazy-max/ghaction-docker-buildx@v1 | ||
with: | ||
buildx-version: latest | ||
- name: Available platforms | ||
run: echo ${{ steps.buildx.outputs.platforms }} | ||
- name: Login | ||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }} | ||
- name: Build | ||
run: docker buildx build -f Dockerfile.base -t ${ORG}/github-runner-base:latest --output "type=image,push=true" --platform linux/amd64,linux/arm64 . | ||
- name: Copy Repo Files | ||
uses: actions/checkout@master | ||
- name: Get GitHub organization or user | ||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY}) | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: latest | ||
install: true | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: ${ORG}/github-runner-base:latest | ||
platforms: linux/amd64,linux/arm64,linux/386 | ||
file: ./Dockerfile.base | ||
|
||
ubuntu_base_bionic_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Copy Repo Files | ||
uses: actions/checkout@master | ||
- name: Get GitHub organization or user | ||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY}) | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: crazy-max/ghaction-docker-buildx@v1 | ||
with: | ||
buildx-version: latest | ||
- name: Available platforms | ||
run: echo ${{ steps.buildx.outputs.platforms }} | ||
- name: Copy Dockerfile | ||
run: cp Dockerfile.base Dockerfile.base.ubuntu-bionic; sed -i.bak 's/FROM.*/FROM ubuntu:bionic/' Dockerfile.base.ubuntu-bionic | ||
- name: Login | ||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }} | ||
- name: Build | ||
run: docker buildx build -f Dockerfile.base.ubuntu-bionic -t ${ORG}/github-runner-base:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 . | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Get GitHub organization or user | ||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY}) | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: latest | ||
install: true | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Copy Dockerfile | ||
run: cp Dockerfile.base Dockerfile.base.ubuntu-bionic; sed -i.bak 's/FROM.*/FROM ubuntu:bionic/' Dockerfile.base.ubuntu-bionic | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: ${ORG}/github-runner-base:ubuntu-bionic | ||
platforms: linux/amd64,linux/arm64,linux/386 | ||
file: ./Dockerfile.base.ubuntu-bionic | ||
|
||
ubuntu_base_xenial_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Copy Repo Files | ||
uses: actions/checkout@master | ||
- name: Get GitHub organization or user | ||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY}) | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: crazy-max/ghaction-docker-buildx@v1 | ||
with: | ||
buildx-version: latest | ||
- name: Available platforms | ||
run: echo ${{ steps.buildx.outputs.platforms }} | ||
- name: Copy Dockerfile | ||
run: cp Dockerfile.base Dockerfile.base.ubuntu-xenial; sed -i.bak 's/FROM.*/FROM ubuntu:xenial/' Dockerfile.base.ubuntu-xenial | ||
- name: Login | ||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }} | ||
- name: Build | ||
run: docker buildx build -f Dockerfile.base.ubuntu-xenial -t ${ORG}/github-runner-base:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm64 . | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Get GitHub organization or user | ||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY}) | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: latest | ||
install: true | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Copy Dockerfile | ||
run: cp Dockerfile.base Dockerfile.base.ubuntu-xenial; sed -i.bak 's/FROM.*/FROM ubuntu:xenial/' Dockerfile.base.ubuntu-xenial | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: ${ORG}/github-runner-base:ubuntu-xenial | ||
platforms: linux/amd64,linux/arm64,linux/386 | ||
file: ./Dockerfile.base.ubuntu-xenial |