Skip to content

Commit

Permalink
Set up aws role and upload to s3.
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyikuang committed Sep 4, 2024
1 parent 20b7715 commit 0d58708
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/docker-openstudio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ env:
OPENSTUDIO_SHA: f953b6fcaf
OPENSTUDIO_VERSION_EXT: ""

permissions:
contents: read
id-token: write

jobs:
docker:
Expand Down Expand Up @@ -48,6 +51,14 @@ jobs:
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}

apptainer:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8.x'

- name: install apptainer
shell: bash
run: |
Expand All @@ -66,3 +77,18 @@ jobs:
with:
name: apptainer-image
path: OpenStudio-${{ env.OPENSTUDIO_VERSION }}${{ env.OPENSTUDIO_VERSION_EXT }}.${{ env.OPENSTUDIO_SHA }}-Apptainer.sif

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
role-to-assume: arn:aws:iam::471211731895:role/OpenStudioGitHubActionsRole
role-session-name: GitHubActions

- name: Upload artifacts to AWS S3
uses: usualdesigner/s3-artifact-upload@main
with:
bucket-name: openstudio-builds
prefix: ${{env.OPENSTUDIO_VERSION}}
file: OpenStudio-${{ env.OPENSTUDIO_VERSION }}${{ env.OPENSTUDIO_VERSION_EXT }}.${{ env.OPENSTUDIO_SHA }}-Apptainer.sif

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAINTAINER Nicholas Long [email protected]

# Set the version of OpenStudio when building the container. For example `docker build --build-arg
ARG OPENSTUDIO_VERSION=3.8.0
ARG OPENSTUDIO_VERSION_EXT=""
ARG OPENSTUDIO_VERSION_EXT="f953b6fcaf"
ARG OPENSTUDIO_DOWNLOAD_URL=https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-3.8.0%2Bf953b6fcaf-Ubuntu-20.04-x86_64.deb
ENV RC_RELEASE=TRUE
ENV OS_BUNDLER_VERSION=2.4.10
Expand Down

0 comments on commit 0d58708

Please sign in to comment.