Skip to content

Commit

Permalink
Rollback aws upload step
Browse files Browse the repository at this point in the history
  • Loading branch information
syjn99 committed Sep 7, 2024
1 parent d141a31 commit e1b95e9
Showing 1 changed file with 57 additions and 28 deletions.
85 changes: 57 additions & 28 deletions .github/workflows/tag-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,63 @@ jobs:
tag_name: ${{ needs.extract-version.outputs.tag_name }}
version_name: ${{ needs.extract-version.outputs.version_name }}

# upload-aws:
# needs: [build, extract-version]
# runs-on: ubuntu-latest
# steps:
# - 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: ${{ secrets.AWS_REGION }}

# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# path: dist/${{ github.sha }}

# - name: Upload to S3
# run: |
# aws s3 cp dist/${{ github.sha }} \
# s3://${{ secrets.AWS_BUCKET_NAME }}/${{ needs.extract-version.outputs.version_name }}/${{ needs.extract-version.outputs.tag_name }} \
# --recursive --acl public-read

# - name: Update latest S3 bucket (when version_name is stable)
# if: ${{ needs.extract-version.outputs.version_name == 'stable' }}
# run: |
# aws s3 cp dist/${{ github.sha }} \
# s3://${{ secrets.AWS_BUCKET_NAME }}/latest/chronos \
# --recursive --acl public-read
upload-aws:
needs: [build, extract-version]
runs-on: ubuntu-latest
steps:
- 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: ${{ secrets.AWS_REGION }}

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/${{ github.sha }}

- name: Upload to S3
run: |
aws s3 cp dist/${{ github.sha }} \
s3://${{ secrets.AWS_BUCKET_NAME }}/${{ needs.extract-version.outputs.version_name }}/${{ needs.extract-version.outputs.tag_name }} \
--recursive --acl public-read
upload-aws-latest:
needs: [build, extract-version]
runs-on: ubuntu-latest
if: ${{ needs.extract-version.outputs.tag_name == 'stable' }}
steps:
- 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: ${{ secrets.AWS_REGION }}

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/${{ github.sha }}

- name: Download latest.yml from S3
run: |
aws s3 cp s3://${{ secrets.AWS_BUCKET_NAME }}/latest/latest.yml latest.yml
- name: Update latest.yml file for chronos
run: |
echo "Updating chronos version and tag in latest.yml"
yq eval '.chronos.version = "${{ needs.extract-version.outputs.version_name }}" | .chronos.tag = "${{ needs.extract-version.outputs.tag_name }}"' -i latest.yml
- name: Upload updated latest.yml to S3
run: |
aws s3 cp latest.yml s3://${{ secrets.AWS_BUCKET_NAME }}/latest/latest.yml --acl public-read
- name: Upload to S3
run: |
aws s3 cp dist/${{ github.sha }} \
s3://${{ secrets.AWS_BUCKET_NAME }}/latest/chronos \
--recursive --acl public-read
build-docker:
needs: [extract-version]
Expand Down

0 comments on commit e1b95e9

Please sign in to comment.