Skip to content

Commit

Permalink
feat: run scaf using IMAGE_TAG environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rochecompaan committed Feb 15, 2024
1 parent aa6cb34 commit 77a2e01
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/setup-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@ name: Create scaf project
on: [push, pull_request]

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/#-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: sixfeetup/scaf:${{ env.GITHUB_SHA }}

setup:
needs: build-and-push
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -18,5 +37,6 @@ jobs:
- name: Create Project with Scaf
shell: bash
run: |
IMAGE_TAG=$GITHUB_SHA
/usr/local/bin/scaf myproject --no-input
4 changes: 2 additions & 2 deletions scaf
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ else
COOKIECUTTER_OPTIONS=""
fi

# Run docker with the specified options
IMAGE_TAG=${IMAGE_TAG:-latest}
docker run --rm -it -v "$(pwd):/home/scaf/out" \
-e HOST_UID="$(id -u)" \
-e HOST_GID="$(id -g)" \
sixfeetup/scaf:latest \
sixfeetup/scaf:$IMAGE_TAG \
cookiecutter \
$COOKIECUTTER_OPTIONS \
$REPO_URL \
Expand Down

0 comments on commit 77a2e01

Please # to comment.