Skip to content

Commit

Permalink
Dev/Deploy Image Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
metaskills committed May 18, 2023
1 parent 7ac8c1a commit c3af772
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 20 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
name: Deploy
on: workflow_dispatch
jobs:
image:
name: Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: devcontainers/ci@v0.2
with:
push: always
imageName: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
cacheFrom: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
runCmd: echo DONE!
deploy:
# https://github.com/devcontainers/ci/issues/192
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: image
permissions:
id-token: write
contents: read
Expand All @@ -24,17 +42,10 @@ jobs:
role-to-assume: arn:aws:iam::589405201853:role/oidc-role-github
role-duration-seconds: 900
role-session-name: lamby-benchmark
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy
uses: devcontainers/ci@v0.2
with:
push: always
imageName: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
push: never
cacheFrom: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
env: |
CI
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
name: Test
on: [push]
jobs:
image:
name: Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: devcontainers/ci@v0.2
with:
push: always
imageName: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
cacheFrom: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
runCmd: echo DONE!
test:
# https://github.com/devcontainers/ci/issues/192
runs-on: ubuntu-20.04
needs: image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -14,17 +32,10 @@ jobs:
./vendor/bundle
./node_modules
key: ${{ runner.os }}-test-v1-${{ hashFiles('Gemfile.lock', 'yarn.lock') }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup & Test
uses: devcontainers/ci@v0.2
with:
push: always
imageName: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
push: never
cacheFrom: ghcr.io/rails-lambda/lamby-benchmark-devcontainer
env: |
CI
Expand Down

0 comments on commit c3af772

Please sign in to comment.