-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (28 loc) · 965 Bytes
/
deploy.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
name: deploy
on:
push:
branches:
- "main"
jobs:
build:
uses: ./.github/workflows/build.yml
secrets:
default_user: ${{ secrets.LC_DEFAULT_USER }}
packer_token: ${{ secrets.LC_PACKER_GITHUB_API_TOKEN }}
ssh_key: ${{ secrets.LC_SSH_AUTH_KEY }}
deploy:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Restore image
uses: actions/download-artifact@v2
- name: Upload server image to S3
if: env.AWS_ACCESS_KEY_ID != null && env.AWS_SECRET_ACCESS_KEY != null && env.AWS_REGION != null && env.AWS_BUCKET_S3_URI != null
id: create_server_href
run: aws s3 cp * ${{ env.AWS_BUCKET_S3_URI }}
working-directory: images
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_REGION: ${{secrets.AWS_REGION}}
AWS_BUCKET_S3_URI: ${{ secrets.AWS_BUCKET_S3_URI }}