Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronjob to sync with s3 #278

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
01127bc
try testing in github actions
James-T-Ardian Oct 14, 2023
f4c270d
eslint and mdspell
James-T-Ardian Oct 14, 2023
0866ba5
try s3 upload
James-T-Ardian Oct 28, 2023
c4de092
single change
James-T-Ardian Oct 28, 2023
8f7a29d
add destination dir
James-T-Ardian Oct 28, 2023
1b3cc7b
make one change
James-T-Ardian Oct 28, 2023
6f7a0c4
try using starport s3 bucket
James-T-Ardian Nov 4, 2023
d24924f
check if secrets work
James-T-Ardian Nov 4, 2023
425cfd6
try with private test bucket
James-T-Ardian Nov 4, 2023
aaa5778
test send
James-T-Ardian Nov 4, 2023
1356ad4
make docs folder replacable in script
James-T-Ardian Dec 6, 2023
85186d8
Merge branch 'master' into jamesA-githubactions-testing
James-T-Ardian Dec 6, 2023
c045a1d
finished first draft of github actions (make it trigger by push for now)
James-T-Ardian Dec 6, 2023
90b3b75
change name of github actions file
James-T-Ardian Dec 6, 2023
e45e364
fix yaml syntax
James-T-Ardian Dec 6, 2023
58b5024
fix branch creation
James-T-Ardian Dec 6, 2023
7a2ef99
change branch ref
James-T-Ardian Dec 6, 2023
6df288f
try again
James-T-Ardian Dec 6, 2023
cea693b
remove upstring tag
James-T-Ardian Dec 6, 2023
6655e3f
change again
James-T-Ardian Dec 6, 2023
078a9d0
manually trigger changes
James-T-Ardian Dec 6, 2023
7203d47
trigger workflow again
James-T-Ardian Dec 6, 2023
f66d5f8
try again
James-T-Ardian Dec 6, 2023
ac079c9
see if files are actually downloaded
James-T-Ardian Dec 6, 2023
b207b13
for some reason PR is not working
James-T-Ardian Dec 6, 2023
8120099
Sync docs folder
Dec 6, 2023
4506161
try removing PR creation
James-T-Ardian Dec 6, 2023
7a3c3d7
merge
James-T-Ardian Dec 6, 2023
1785a97
try creating a PR using gh
James-T-Ardian Dec 6, 2023
f6245ce
make workflow run on push and also on schedule
James-T-Ardian Dec 6, 2023
259b16d
Sync docs folder
Dec 6, 2023
f2181fc
Merge pull request #2 from James-T-Ardian/sync-24500
James-T-Ardian Dec 6, 2023
bf2823e
remove on push
James-T-Ardian Dec 6, 2023
9fb4f4c
Merge branch 'jamesA-githubactions-testing' of https://github.com/Jam…
James-T-Ardian Dec 6, 2023
0fd1e93
try
James-T-Ardian Dec 6, 2023
07446fa
another one
James-T-Ardian Dec 6, 2023
d5bfbfb
try
James-T-Ardian Dec 6, 2023
35170a8
ready up cronjob for master
James-T-Ardian Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: S3-synchronization-cronjob

on:
schedule:
- cron: '*/30 * * * *'

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.GH_TOKEN }}
- name: Generate random number
id: random
run: echo "::set-output name=value::$(echo $RANDOM)"
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Create branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
branch: sync-${{ steps.random.outputs.value }}
- uses: actions/checkout@v4
with:
ref: sync-${{ steps.random.outputs.value }}
token: ${{ secrets.GH_TOKEN }}
- name: create env file
run: |
touch .env
echo AWS_STARPORT_BAR_AK=${{ secrets.AWS_STARPORT_BAR_AK }} >> .env
echo AWS_STARPORT_BAR_SAK=${{ secrets.AWS_STARPORT_BAR_SAK }} >> .env
echo REPOSITORY_ID=${{ secrets.REPOSITORY_ID }} >> .env
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npm install
- run: npm run sync-script
- name: commit and push new file
run: |
git config --global user.name "S3 Synchronization Cronjob"
git config --global user.email "<>"
git add .
git commit --allow-empty -m "Cronjob/Sync docs folder with s3"
git push
- name: create pull request
run: |
gh pr create -B master -H sync-${{ steps.random.outputs.value }} --title 'Cronjob/Sync docs folder with s3' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Loading