-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 2.07 KB
/
platformsh.yml
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
# This workflow will build and push to Platform.sh
#
# To use this workflow, you will need to complete the following set-up steps:
#
# 1. Create a Platform.sh project.
# Reference: https://docs.platform.sh/gettingstarted/own-code/create-project.html
# https://docs.platform.sh/gettingstarted/template/create-project.html
# https://console.platform.sh/
#
# 2. Create a Platform.sh API Tokens
# https://docs.platform.sh/development/cli/api-tokens.html
#
# 3. Generate a Githu token
# https://docs.platform.sh/administration/integrations/github.html
# https://github.com/settings/tokens/new
#
# 4. Store a Platform.sh project ID in GitHub Actions secrets named `PLATFORM_PROJECT_ID`
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets
#
# 5. Store a Platform.sh API tokens in GitHub Actions secrets named `PLATFORM_AUTHENTICATION`
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets
#
# 6. Store a Github API token in GitHub Actions secrets named `TOKEN_GITHUB`
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets
#
name: Deploy on Platform.sh
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Deploy with Platform.sh
env:
HEADER: 'Content-Type: application/json'
PLATFORM_AUTHENTICATION: ${{ secrets.PLATFORM_AUTHENTICATION }}
PLATFORM_PROJECT_ID: ${{ secrets.PLATFORM_PROJECT_ID }}
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
run: |
export AUTHENCICATION="Authorization: Bearer ${PLATFORM_AUTHENTICATION}"
export HOST=https://api.platform.sh/projects/$PLATFORM_PROJECT_ID/integrations
export BODY="'{\"type\": \"GithubIntegrationCreateInput\", \"token\": \"${GITHUB_TOKEN}\", \"repository\": \"${GITHUB_REPOSITORY}\"}'"
echo $BODY
echo $HEADER
echo $AUTHENCICATION
echo $HOST
curl -d $BODY -H $HEADER -H $AUTHENCICATION -X POST $HOST