-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (47 loc) · 1.72 KB
/
production.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
name: "♨️ Send email - Production"
on:
workflow_dispatch:
jobs:
send-email-for-all-users:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: composer:v2
- name: Install Composer dependencies
run: |
cd src
composer install --no-progress --optimize-autoloader --quiet
- name: Import BOTTOM_CONTENT_HTML and TOP_CONTENT_HTML into env
shell: bash
run: |
cd src
echo "BOTTOM_CONTENT_HTML=$(cat BOTTOM_CONTENT_HTML.txt)" >> $GITHUB_ENV
echo "TOP_CONTENT_HTML=$(cat TOP_CONTENT_HTML.txt)" >> $GITHUB_ENV
- name: Run script
run: php src/send_newsletter.php
env:
PAKAT_SMTP_USERNAME: ${{ secrets.PAKAT_SMTP_USERNAME }}
PAKAT_SMTP_PASSWORD: ${{ secrets.PAKAT_SMTP_PASSWORD }}
PAKAT_API_KEY: ${{ secrets.PAKAT_API_KEY }}
GITHUB_USER_NAME: ${{ secrets.STN_GITHUB_USER_NAME }}
GITHUB_TOKEN: ${{ secrets.STN_GITHUB_TOKEN }}
BOTTOM_CONTENT_HTML: ${{ env.BOTTOM_CONTENT_HTML }}
TOP_CONTENT_HTML: ${{ env.TOP_CONTENT_HTML }}
SEND_ENV: "production"
IS_DARK: "false"
- name: Commit Archive file
run: |
git config --local user.email "ohmydevops@gmail.com"
git config --local user.name "ohmydevops"
git add -A
git commit -m "Add Archive"
- name: Push Archive file
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.STN_GITHUB_TOKEN }}
branch: main