-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add test container image and automation (#664)
Signed-off-by: Anton Baliasnikov <[email protected]>
- Loading branch information
Anton Baliasnikov
authored
Aug 30, 2023
1 parent
b3c0bae
commit 24284f8
Showing
3 changed files
with
95 additions
and
8 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,25 @@ | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends --yes \ | ||
git=1:2.* \ | ||
curl=7.* \ | ||
wget=1.21.* \ | ||
unzip=6.* \ | ||
zip=3.* \ | ||
jq=1.* \ | ||
python3=3.10.* \ | ||
python3-pip=22.* \ | ||
python3-setuptools=59.6.* \ | ||
python3-wheel=0.37.* \ | ||
gnupg=2.2.* \ | ||
default-jre=2:1.* \ | ||
build-essential=12.* && \ | ||
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list && \ | ||
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list && \ | ||
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import && \ | ||
chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg && \ | ||
apt-get --allow-releaseinfo-change update && \ | ||
apt-get install --no-install-recommends --yes \ | ||
sbt=1.4.* \ | ||
&& rm -rf /var/lib/apt/lists/* |
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,60 @@ | ||
name: Build Test Docker image | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- ".github/docker/**" | ||
- ".github/workflows/build-test-docker.yml" | ||
pull_request: | ||
paths: | ||
- ".github/docker/**" | ||
- ".github/workflows/build-test-docker.yml" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: agent-ci-ubuntu-22-jdk-11 | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build Docker image | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: .github/docker | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Build and push Docker image | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: .github/docker | ||
push: true | ||
tags: | | ||
"ghcr.io/input-output-hk/${env.IMAGE_NAME}:latest" | ||
"ghcr.io/input-output-hk/${env.IMAGE_NAME}:main" | ||
labels: ${{ steps.meta.outputs.labels }} |
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