forked from actions/actions-runner-controller
-
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.
ci: separate ubuntu versions out in ci (actions#969)
* ci: separate ubuntu versions out in ci
- Loading branch information
1 parent
47a1775
commit 031b184
Showing
7 changed files
with
170 additions
and
126 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "Setup Docker" | ||
|
||
inputs: | ||
username: | ||
description: "Username" | ||
required: true | ||
password: | ||
description: "Password" | ||
required: true | ||
|
||
outputs: | ||
sha_short: | ||
description: "The short SHA used for image builds" | ||
value: ${{ steps.vars.outputs.sha_short }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get Short SHA | ||
id: vars | ||
run: | | ||
echo ::set-output name=sha_short::${GITHUB_SHA::7} | ||
shell: bash | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: latest | ||
|
||
- name: Login to DockerHub | ||
if: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ inputs.username }} | ||
password: ${{ inputs.password }} |
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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Ubuntu 18.04 Runners | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- closed | ||
branches: | ||
- 'master' | ||
paths: | ||
- 'runner/**' | ||
- .github/workflows/ubuntu-18-04-runners.yml | ||
- '!**.md' | ||
- '!runner/Dockerfile' | ||
- '!runner/Dockerfile.dindrunner' | ||
|
||
env: | ||
RUNNER_VERSION: 2.284.0 | ||
DOCKER_VERSION: 20.10.8 | ||
DOCKERHUB_USERNAME: summerwind | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build ${{ matrix.name }}-ubuntu-${{ matrix.os-version }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: actions-runner | ||
os-version: 18.04 | ||
dockerfile: Dockerfile.ubuntu.1804 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Docker Environment | ||
id: vars | ||
uses: ./.github/actions/setup-docker-environment | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Build and Push Versioned Tags | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./runner | ||
file: ./runner/${{ matrix.dockerfile }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} | ||
build-args: | | ||
RUNNER_VERSION=${{ env.RUNNER_VERSION }} | ||
DOCKER_VERSION=${{ env.DOCKER_VERSION }} | ||
tags: | | ||
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-ubuntu-${{ matrix.os-version }} | ||
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-ubuntu-${{ matrix.os-version }}-${{ steps.vars.outputs.sha_short }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Ubuntu 20.04 Runners | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- closed | ||
branches: | ||
- 'master' | ||
paths: | ||
- 'runner/**' | ||
- .github/workflows/ubuntu-20-04-runners.yml | ||
- '!**.md' | ||
- '!runner/Dockerfile.ubuntu.1804' | ||
|
||
env: | ||
RUNNER_VERSION: 2.284.0 | ||
DOCKER_VERSION: 20.10.8 | ||
DOCKERHUB_USERNAME: summerwind | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build ${{ matrix.name }}-ubuntu-${{ matrix.os-version }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: actions-runner | ||
os-version: 20.04 | ||
dockerfile: Dockerfile | ||
- name: actions-runner-dind | ||
os-version: 20.04 | ||
dockerfile: Dockerfile.dindrunner | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Docker Environment | ||
id: vars | ||
uses: ./.github/actions/setup-docker-environment | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Build and Push Versioned Tags | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./runner | ||
file: ./runner/${{ matrix.dockerfile }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} | ||
build-args: | | ||
RUNNER_VERSION=${{ env.RUNNER_VERSION }} | ||
DOCKER_VERSION=${{ env.DOCKER_VERSION }} | ||
tags: | | ||
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-ubuntu-${{ matrix.os-version }} | ||
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-ubuntu-${{ matrix.os-version }}-${{ steps.vars.outputs.sha_short }} | ||
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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