1 2 3 4 5 6 7 8 9 10 11 12 13 |
# インストール curl https://raw.githubusercontent.com/nektos/act/master/install.sh | bash sudo mv bin/act /usr/local/bin/a # ワークフロー確認 act -l # secret情報をファイルに持たす AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=xxx # 実行 act push --secret-file .secrets |
awscliでs3を扱う場合のサンプル
aws-actions/configure-aws-credentials@v1を呼び出すとaws資格情報がセットされると思ったらそうではなかった(普通にrun aws xxxとかはできないみたい。。)
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 |
name: Amazon S3 Sample on: push: branches: - develop jobs: build: runs-on: ubuntu-latest timeout-minutes: 5 env: AWS_ENVIRONMENT: latest steps: - name: Checkout uses: actions/checkout@v2 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ap-northeast-1 - name: Download File from S3 uses: docker://amazon/aws-cli:2.0.7 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} with: args: aws s3 ls s3://vamdemic-${{ env.AWS_ENVIRONMENT }}-alb-log |