Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added build and push container image #39

Merged
merged 9 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
build-and-push:
name: Build and push container image
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
matrix:
images:
- dockerfile: ./build.Dockerfile
image_name: ghcr.io/dena/unity-meta-check/unity-meta-check-builder
- dockerfile: ./Dockerfile
image_name: ghcr.io/dena/unity-meta-check/unity-meta-check
- dockerfile: ./.github/images/Dockerfile
image_name: ghcr.io/dena/unity-meta-check/unity-meta-check-gh-action
- dockerfile: ./.circleci/images/Dockerfile
image_name: ghcr.io/dena/unity-meta-check/unity-meta-check-circleci

steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
submodules: recursive

- uses: nowsprinting/check-version-format-action@98485692a883d962227b09f40f29a63de0771299 # v4.0.2
id: version
with:
prefix: "v"

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Login to ghcr.io
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
platforms: linux/amd64,linux/arm64
file: ${{ matrix.images.dockerfile }}
tags: ${{ matrix.images.image_name }}:${{ github.ref_name }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
Kuniwak marked this conversation as resolved.
Show resolved Hide resolved

- name: Add latest tag
if: steps.version.outputs.is_stable == 'true'
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
platforms: linux/amd64,linux/arm64
file: ${{ matrix.images.dockerfile }}
tags: ${{ matrix.images.image_name }}:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
9 changes: 0 additions & 9 deletions scripts/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ usage: deploy [<options>]

OPTIONS
-h, --help print this usage
--latest also tag the docker image as the latest
EOS
}

Expand All @@ -43,8 +42,6 @@ usage-error() {


main() {
local arg="${1:-}"

has go || throw "'go' must be installed (see https://golang.org)"
has gh || throw "'gh' must be installed (see https://cli.github.com)"
has docker || throw "'docker' must be installed (see https://www.docker.com)"
Expand All @@ -65,12 +62,6 @@ main() {
(cd "$BASE_DIR"
./scripts/deploy-gh-release
./scripts/deploy-bins

if [[ "$arg" == "--latest" ]]; then
./scripts/deploy-images --latest
else
./scripts/deploy-images
fi
)
}

Expand Down
118 changes: 0 additions & 118 deletions scripts/deploy-images

This file was deleted.