Skip to content

Commit

Permalink
Merge pull request #726 from rstudio/dev
Browse files Browse the repository at this point in the history
Dev to Main
  • Loading branch information
ianpittwood committed Apr 19, 2024
2 parents ceeffee + 4bef135 commit 4235ea7
Show file tree
Hide file tree
Showing 98 changed files with 3,623 additions and 2,612 deletions.
119 changes: 119 additions & 0 deletions .github/actions/bake-test-push/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: 'Build/Test/Scan/Push Image'
inputs:
target:
description: Target or group to bake
required: true
type: string
bakefile:
description: Path to the bakefile
required: true
default: "docker-bake.hcl"
type: string
env-vars:
description: A semicolon delimited list of environment variables to set as overrides for the bake definition
required: false
type: string
test-image:
description: Flag to test image once built
default: true
type: boolean
push-image:
description: Flag to push image once built
default: false
type: boolean
ghcr-token:
description: Username for authentication with GHCR.io
required: true
type: string
dockerhub-username:
description: Username for authentication with DockerHub
required: true
type: string
dockerhub-token:
description: Username for authentication with DockerHub
required: true
type: string
gcp-json:
description: JSON for authenticating Google Cloud Platform
default: ""
type: string

runs:
using: "composite"
steps:
# Setup dependencies and tools
- name: Set up Just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ inputs.ghcr-token }}

- uses: actions/setup-python@v5
with:
python-version: '3.12'

# Authenticate to registries
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.ghcr-token }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub-username }}
password: ${{ inputs.dockerhub-token }}

- name: Login to GCAR us-central1
continue-on-error: true
uses: docker/login-action@v3
with:
registry: us-central1-docker.pkg.dev
username: _json_key
password: '${{ inputs.gcp-json }}'

- name: Login to GCAR us
continue-on-error: true
uses: docker/login-action@v3
with:
registry: us-docker.pkg.dev
username: _json_key
password: '${{ inputs.gcp-json }}'

- name: Login to GCAR asia
continue-on-error: true
uses: docker/login-action@v3
with:
registry: asia-docker.pkg.dev
username: _json_key
password: '${{ inputs.gcp-json }}'

- name: Login to GCAR europe
continue-on-error: true
uses: docker/login-action@v3
with:
registry: europe-docker.pkg.dev
username: _json_key
password: '${{ inputs.gcp-json }}'

# Build, test, and push image
- name: Build
id: build
uses: docker/bake-action@v4
with:
targets: "${{ inputs.target }}"
push: false
files: ${{ inputs.bakefile }}

- name: Test
shell: bash
run: |
just test "${{ inputs.target }}" "${{ inputs.bakefile }}"
- name: Push - ${{ inputs.push-image }}
uses: docker/bake-action@v4
with:
targets: "${{ inputs.target }}"
push: ${{ inputs.push-image }}
files: ${{ inputs.bakefile }}
Loading

0 comments on commit 4235ea7

Please sign in to comment.