-
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
78ecfad
commit fc9bd26
Showing
1 changed file
with
53 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,53 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
NAMESPACE: globalart-prod | ||
HARBOR_PROJECT: gitlab-prod | ||
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }} | ||
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }} | ||
HARBOR_HOST: ${{ secrets.HARBOR_HOST }} | ||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup kubectl | ||
uses: azure/setup-kubectl@v1 | ||
|
||
- name: Setup helm | ||
uses: azure/setup-helm@v1 | ||
|
||
- name: Copy kubeconfig | ||
run: | | ||
mkdir -p ~/.kube | ||
echo "$KUBE_CONFIG" > ~/.kube/config | ||
- name: Setup trdl and werf | ||
run: | | ||
mkdir -p ~/.local/bin | ||
export PATH=$HOME/.local/bin:$PATH | ||
curl -L https://tuf.trdl.dev/trdl.sh | sh | ||
source $HOME/.local/bin/trdl use werf "1.2" "stable" | ||
source $(werf ci-env github --as-file) | ||
- name: Login to Harbor | ||
run: "werf cr login -u $HARBOR_USERNAME -p $HARBOR_PASSWORD $HARBOR_HOST" | ||
- name: Deploy with werf | ||
run: | | ||
werf converge --namespace=$NAMESPACE \ | ||
--env prod \ | ||
--kube-config=~/.kube/config \ | ||
--skip-tls-verify-registry=true \ | ||
--repo-container-registry=harbor \ | ||
--repo=$HARBOR_HOST/${HARBOR_PROJECT}/$GITHUB_REPOSITORY \ | ||
--repo-harbor-username=$HARBOR_USERNAME \ | ||
--repo-harbor-password=$HARBOR_PASSWORD \ | ||
--atomic=true |