Merge pull request #73 from rayui/issue-72 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |