-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from SpaceApi/fix-ci-trigger
Split CI and publish runs into separate workflows
- Loading branch information
Showing
2 changed files
with
26 additions
and
28 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 |
---|---|---|
@@ -1,41 +1,13 @@ | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
schedule: | ||
- cron: '30 3 * * 2' | ||
|
||
name: CI | ||
|
||
jobs: | ||
test: | ||
name: Build website | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
run: docker build --no-cache . | ||
|
||
publish: | ||
name: Publish Docker image | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
id: extract_branch | ||
- name: Build Docker image | ||
run: | | ||
docker build \ | ||
--no-cache \ | ||
-t spaceapi/website:latest \ | ||
-t spaceapi/website:v3 \ | ||
-t spaceapi/website:${{ steps.extract_branch.outputs.branch }} \ | ||
. | ||
- name: Push Docker image | ||
run: | | ||
docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" && \ | ||
docker push -a spaceapi/website |
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,26 @@ | ||
on: | ||
push: | ||
branches: [master] | ||
schedule: | ||
- cron: '30 3 * * 2' | ||
|
||
name: Publish | ||
|
||
jobs: | ||
publish: | ||
name: Publish Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
run: | | ||
docker build \ | ||
--no-cache \ | ||
-t spaceapi/website:latest \ | ||
-t spaceapi/website:v3 \ | ||
-t spaceapi/website:master \ | ||
. | ||
- name: Push Docker image | ||
run: | | ||
docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" && \ | ||
docker push -a spaceapi/website |