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

fix(ci): manual docker push #545

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
45 changes: 7 additions & 38 deletions .github/workflows/ci_docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,14 @@ on:
sha_short:
description: 'sha_short'
required: true
new_tag:
description: 'new_tag'
required: true
new_tag_short:
description: 'new_tag_short'
required: true
name:
description: 'name'
required: true
sha:
description: "sha"
tag:
description: 'tag'
required: true
jobs:
build-docker-image:
name: Build and push Docker image
runs-on: ubuntu-latest
if: github.event.inputs.name || github.event.inputs.new_tag
if: github.event.inputs.tag
env:
IMAGE_NAME: reearth/reearth
defaults:
Expand All @@ -42,37 +33,15 @@ jobs:
- name: Get options
id: options
env:
TAG: ${{ github.event.inputs.new_tag_short }}
NAME: ${{ github.event.inputs.name }}
TAG: ${{ github.event.inputs.tag }}
SHA: ${{ github.event.inputs.sha_short }}
run: |
if [[ -n $TAG ]]; then
PLATFORMS=linux/amd64,linux/arm64
VERSION=$TAG
TAGS=$IMAGE_NAME:$TAG
if [[ ! $TAG =~ '-' ]]; then
TAGS+=,${IMAGE_NAME}:${TAG%.*}
TAGS+=,${IMAGE_NAME}:${TAG%%.*}
TAGS+=,${IMAGE_NAME}:latest
fi
else
PLATFORMS=linux/amd64
VERSION=$SHA
TAGS=$IMAGE_NAME:$NAME
fi
PLATFORMS=linux/amd64
VERSION=$SHA
TAGS=$IMAGE_NAME:$TAG
echo "::set-output name=platforms::$PLATFORMS"
echo "::set-output name=version::$VERSION"
echo "::set-output name=tags::$TAGS"
- name: Fetch reearth-web release
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: reearth/reearth
version: tags/${{ github.event.inputs.name || needs.info.outputs.tag }}
file: reearth-web_${{ github.event.inputs.name || needs.info.outputs.tag }}.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
target: server/reearth-web.tar.gz
- name: Extract reearth/web
run: tar -xvf reearth-web.tar.gz; mv reearth-web web; ls
- name: Build and push docker image
uses: docker/build-push-action@v2
with:
Expand Down