-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (64 loc) · 1.95 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: build
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
permissions:
actions: read
checks: write
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Get faas-cli
run: curl -sLSf https://cli.openfaas.com | sudo sh
# - name: Pull custom templates from stack.yml
# run: faas-cli template pull stack
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::latest-dev
- name: Get Repo Owner
id: get_repo_owner
run: >
echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} |
tr '[:upper:]' '[:lower:]')
- name: Docker Login
run: >
echo ${{secrets.GITHUB_TOKEN}} |
docker login ghcr.io --username
${{ steps.get_repo_owner.outputs.repo_owner }}
--password-stdin
- name: Publish functions
run: >
OWNER="${{ steps.get_repo_owner.outputs.repo_owner }}"
TAG="latest"
faas-cli publish
--extra-tag ${{ github.sha }}
--platforms linux/amd64
- name: Login
run: >
echo ${{secrets.OPENFAAS_PASSWORD}} |
faas-cli login --gateway ${{secrets.OPENFAAS_URL}}
--password-stdin
- name: Create secrets
run: >
faas-cli secret create twitter-discord-webhook-url
--gateway ${{secrets.OPENFAAS_URL}}
--from-literal "${{ secrets.INCOMING_WEBHOOK_URL }}" || echo "Secret already exists"
- name: Deploy
run: >
OWNER="${{ steps.get_repo_owner.outputs.repo_owner }}"
TAG="${{ github.sha }}"
faas-cli deploy --gateway ${{secrets.OPENFAAS_URL}}