-
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.
- Adds stub CI workflow - Adds workflows for deploying to WPVIP develop and production
- Loading branch information
1 parent
c0a8163
commit 2314a67
Showing
3 changed files
with
93 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main, production] | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
jobs: | ||
to-do: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "CI goes here" |
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,38 @@ | ||
name: Develop Deploy | ||
|
||
on: | ||
workflow_run: | ||
workflows: [CI] | ||
types: [completed] | ||
branches: [main] | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.CI_DEPLOY_KEY }} | ||
name: id_goodbids | ||
known_hosts: unnecessary # Actions have have github.com in known_hosts by default | ||
config: | | ||
Host github.com | ||
HostName github.com | ||
IdentityFile /home/runner/.ssh/id_goodbids | ||
if_key_exists: fail | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Push to remote | ||
run: | | ||
git config --unset-all http.https://github.com/.extraheader | ||
git config user.name "GitHub Actions" | ||
git config user.email [email protected] | ||
git remote add wpvip [email protected]:wpcomvip/goodbids.git | ||
git push -f wpvip main:develop |
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,39 @@ | ||
name: Production Deploy | ||
|
||
on: | ||
workflow_run: | ||
workflows: [CI] | ||
types: [completed] | ||
branches: [production] | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.CI_DEPLOY_KEY }} | ||
name: id_goodbidsNode | ||
known_hosts: unnecessary # Actions have have github.com in known_hosts by default | ||
config: | | ||
Host github.com | ||
HostName github.com | ||
IdentityFile /home/runner/.ssh/id_goodbidsNode | ||
if_key_exists: fail | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: production | ||
|
||
- name: Push to remote | ||
run: | | ||
git config --unset-all http.https://github.com/.extraheader | ||
git config user.name "GitHub Actions" | ||
git config user.email [email protected] | ||
git remote add wpvip [email protected]:wpcomvip/goodbids.git | ||
git push -f wpvip production:production |