-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (45 loc) · 1.33 KB
/
main.yml
File metadata and controls
48 lines (45 loc) · 1.33 KB
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
name: Publish site to S3
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- name: Checkout main
uses: actions/checkout@v5.0.0
- name: Build only
uses: shalzz/zola-deploy-action@v0.21.0
env:
BUILD_ONLY: true
- name: Create artifacts
uses: actions/upload-artifact@v5
with:
name: site
path: public
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Download a single artifact
uses: actions/download-artifact@v6
with:
name: site
path: public
- name: Set up S3cmd cli tool
uses: s3-actions/s3cmd@v2.0.1
with:
provider: yandex
region: ru-central1
access_key: ${{ secrets.SYNC_ACCESS_ID }}
secret_key: ${{ secrets.SYNC_ACCESS_SECRET }}
- name: sync to s3
run: |
cd public
s3cmd sync --recursive --exclude "*.css" --exclude "*.js" * s3://code.rpg.ru
s3cmd sync --recursive --include "*.css" * --mime-type="text/css" s3://code.rpg.ru
s3cmd sync --recursive --include "*.js" * --mime-type="application/javascript" s3://code.rpg.ru