Skip to content

Commit

Permalink
💚 [minor] Separate release workflow out of build-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pohfy123 committed Jan 20, 2021
1 parent 9342c8b commit 49cc07b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: Samsahai
name: Build and test
on:
push:
branches:
- master
branches: [ master ]
pull_request:
branches:
- master
branches: [ master ]

jobs:
build-test-release:
name: Build & Test & Release
build-test:
name: Build & Test
runs-on: ubuntu-16.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Expand Down Expand Up @@ -39,10 +37,6 @@ jobs:
with:
path: go/src/github.com/agoda-com/samsahai

- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Prepare ENV
run: |
export GOPATH=/home/runner/work/samsahai/go
Expand Down Expand Up @@ -111,26 +105,3 @@ jobs:
with:
name: test-result
path: ./test/result

# RELEASE
- name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.TEST_GIT_PASSWORD }}
GITHUB_REPO: agoda-com/samsahai
DOCKER_USER: ${{ secrets.QUAY_DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.QUAY_DOCKER_TOKEN }}
run: |
export INSTALL_DIR="$(pwd)/bin/"
git config --global url."ssh://[email protected]".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
ls -al
rm -rf tmp
make auto-release SUDO="sudo "
- name: Docker logout
if: always()
run: |
make .docker-logout
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release
on:
push:
branches: [ master ]

jobs:
release:
name: Release
runs-on: ubuntu-16.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
# BUILD
- uses: actions/setup-go@v1
with:
go-version: '1.15.4'

- uses: actions/checkout@v1
with:
path: go/src/github.com/agoda-com/samsahai

- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Prepare ENV
run: |
export GOPATH=/home/runner/work/samsahai/go
echo "::set-env name=GOROOT::$GOROOT"
echo "::set-env name=GOPATH::$GOPATH"
echo "::set-env name=INSTALL_DIR::$GOPATH/bin/"
# RELEASE
- name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.TEST_GIT_PASSWORD }}
GITHUB_REPO: agoda-com/samsahai
DOCKER_USER: ${{ secrets.QUAY_DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.QUAY_DOCKER_TOKEN }}
run: |
export INSTALL_DIR="$(pwd)/bin/"
git config --global url."ssh://[email protected]".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
rm -rf tmp
make auto-release SUDO="sudo "
- name: Docker logout
if: always()
run: |
make .docker-logout

0 comments on commit 49cc07b

Please sign in to comment.