Skip to content

Commit 7e98947

Browse files
authored
Merge pull request #30 from sonikro/sync-back-to-github
feat(workspace): implemented resync from s3 to runner workspace
2 parents e01d877 + a448eb4 commit 7e98947

File tree

9 files changed

+95737
-17627
lines changed

9 files changed

+95737
-17627
lines changed

Diff for: .github/workflows/test.yml

+29
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,32 @@ jobs:
8383
terraform -v
8484
echo "Hello World. I am ${{github.repository}}"
8585
echo "Testing $GITHUB_REPOSITORY variable"
86+
test-workspace-sync:
87+
runs-on: ubuntu-latest
88+
if: github.repository_owner == 'sonikro'
89+
permissions:
90+
contents: read
91+
id-token: write
92+
steps:
93+
- uses: actions/checkout@v3
94+
95+
- uses: ./
96+
with:
97+
role_arn: "${{secrets.TEST_ROLE_ARN}}"
98+
image: alpine
99+
region: us-east-1
100+
vpc_id: "${{secrets.TEST_VPC_ID}}"
101+
shell: sh
102+
run: |
103+
ls -la
104+
echo "ecs generated contend" > testfile.txt
105+
106+
- shell: bash
107+
run: |
108+
if [ -f "testfile.txt" ];
109+
then
110+
cat testfile.txt
111+
else
112+
echo "testfile is missing"
113+
exit 1
114+
fi

Diff for: README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This action allows you to run a script inside of your AWS Account, without havin
1414
- Pick whic VPC/Subnet you want your Task to run
1515
- Tasks are ephemeral and all resources created to run the task are teared down by the end, making it the ultimate ephemeral task
1616
- Don't worry about setting up your own runners inside your VPC anymore, as you can use any runner with access to the internet to remotely execute code within your AWS Environment
17+
- Seamlessly share files back and forth between your GH Runner and your ECS Task
1718

1819
## Getting Started
1920

@@ -222,7 +223,7 @@ In the execution phase, the action will:
222223
- It waits for the ECS Task to complete.
223224
- It fetches the exitCode of the ECS Task, and use it to determine if the Action should Fail or Succeed
224225
- All logs are streamed to a Cloudwatch Logstream. These logs are then fetched and displayed on GHA (so you don't have to go to AWS Console to see the execution logs)
225-
226+
- Any file changes made in the ECS Task will be synced back to the GitHub Runner
226227
227228
### Teardown
228229
@@ -243,7 +244,7 @@ In the execution phase, the action will:
243244
- [X] Automatically grab list of Subnets for VPC_ID, if Subnet_IDS are not provided
244245
- [ ] Mask secrets inside the Cloudwatch Logs
245246
- [X] Map all GitHub Contexts/ENVS into the ECS Container
246-
- [ ] Ability to upload artifacts back to GitHub (if your remote execution generates artifacts)
247+
- [X] Ability to upload artifacts back to GitHub (if your remote execution generates artifacts)
247248
- [ ] Find a way to map environment variables from the remote shell, back to the runner (after execution)
248249
- [ ] Change the TearDown step to run as a **post** action on GHA, so take advantages of errors/cancellations
249250
- [ ] Make it compatible with [Windows Containers](https://aws.amazon.com/blogs/containers/running-windows-containers-with-amazon-ecs-on-aws-fargate/)

0 commit comments

Comments
 (0)