-
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.
- Loading branch information
1 parent
3d85f6f
commit e5f67c9
Showing
3 changed files
with
58 additions
and
2 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
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,56 @@ | ||
name: mover | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'main' | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
|
||
build: | ||
timeout-minutes: 30 | ||
runs-on: [self-hosted, linux, x64] | ||
|
||
steps: | ||
- name: Checking out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to GCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ vars.REGISTRY }} | ||
username: _json_key | ||
password: ${{ secrets.GCR_JSON_KEY }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ulule | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Removing slashes from branch name when not tag or dev branch | ||
id: git_tag | ||
run: | | ||
if [[ "${{ github.event.pull_request.merged }}" == "true" ]] && [[ "${{ github.ref_name }}" == 'main' ]] && [[ "${{ github.event.pull_request.title }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "GIT_TAG=${{ github.event.pull_request.title }}" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "GIT_TAG=${GIT_REF//\//-}" >> "$GITHUB_OUTPUT" | ||
fi | ||
env: | ||
GIT_REF: ${{ github.ref_name }} | ||
|
||
- name: Build app and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ vars.REGISTRY }}/mover:${{ github.sha }},${{ vars.REGISTRY }}/mover:${{ steps.git_tag.outputs.GIT_TAG }} | ||
cache-from: type=registry,ref=${{ vars.REGISTRY }}/mover:cache | ||
cache-to: type=registry,ref=${{ vars.REGISTRY }}/mover:cache,mode=min,compression=zstd |
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