-
Notifications
You must be signed in to change notification settings - Fork 23
66 lines (52 loc) · 1.99 KB
/
updateFromInstagram.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# This is a basic workflow to help you get started with Actions
name: Update from Instagram
# Controls when the workflow will run
on: issue_comment
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
get:
name: Get Post from Instagram
if: ${{ !github.event.issue.pull_request }} && ${{ github.event.issue.number == 1 }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Extracting URL, Downloading Image in Git Repo Uploading Image
if: ${{ github.actor == 'swiftlysingh' }}
run: |
export URL=$(echo $COMMENT|grep -Eo 'https://[^ >]+'\|head -1)
export SHOT_NAME=$(date "+%m%d%H%M%y")
echo $SHOT_NAME and $URL
wget --output-document=$SHOT_NAME.jpeg $URL
git config --global user.email "[email protected]"
git config --global user.name "bot"
git add $SHOT_NAME.jpeg
git commit -m "Add Image from Instagram"
git push
working-directory: ./images
env:
COMMENT: ${{ github.event.comment.body }}
post:
name: Post to Shots
needs: get
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install --force
- run: |
sudo add-apt-repository ppa:dhor/myway
sudo apt-get update
sudo apt-get install graphicsmagick
git config --global user.email "[email protected]"
git config --global user.name "bot"
- run: |
git pull
- run: gulp
- name: Update and push
run: |
git add images/*
git commit -m "Convert JPEG"
git push -f