-
Notifications
You must be signed in to change notification settings - Fork 1
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
375b994
commit 6c8ec94
Showing
1 changed file
with
65 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,65 @@ | ||
--- | ||
name: Vultr Build & Deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- feat/deployment | ||
|
||
env: | ||
DEPLOYMENT_FILE: das-function.yml | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: das-servless-functions | ||
|
||
- name: Checkout das-infra-stack-vultr Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: singnet/das-infra-stack-vultr | ||
path: das-infra-stack-vultr | ||
ref: master | ||
|
||
- name: Go to das-infra-stack-vultr | ||
run: cd ./das-infra-stack-vultr | ||
|
||
- name: Pull template | ||
uses: docker://openfaas/faas-cli:latest-root | ||
with: | ||
args: template store pull python3 | ||
|
||
- name: Run shrinkwrap build | ||
uses: docker://openfaas/faas-cli:latest-root | ||
with: | ||
args: build -f ${{ env.DEPLOYMENT_FILE }} | ||
|
||
- name: Login to DockerHub | ||
if: success() | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Push Image to Registry | ||
uses: docker://openfaas/faas-cli:latest-root | ||
with: | ||
args: push -f ${{ env.DEPLOYMENT_FILE }} | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to OpenFaaS Gateway | ||
uses: docker://openfaas/faas-cli:latest-root | ||
with: | ||
args: login -p ${{ secrets.OPENFAAS_GATEWAY_PASSWD }} \ | ||
-g ${{ secrets.OPENFAAS_GATEWAY }} | ||
|
||
- name: Deploy the function | ||
uses: docker://openfaas/faas-cli:latest-root | ||
with: | ||
args: deploy -f ${{ env.DEPLOYMENT_FILE }} |