diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..1c74997 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,27 @@ +name: Deploy an application + +on: + workflow_dispatch: + inputs: + app: + type: choice + description: The app to deploy + options: + - widetom + - cargo-bisect-rustc-service + +jobs: + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Login to docker.nilstrieb.dev + uses: docker/login-action@v2 + with: + registry: docker.nilstrieb.dev + username: ${{ secrets.DOCKER_NILSTRIEB_DEV_USER }} + password: ${{ secrets.DOCKER_NILSTRIEB_DEV_PASSWORD }} + - uses: actions/checkout@v3 + - name: Check out application source + run: | + APP=${{ github.event.inputs.app }} diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 0000000..56221c5 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,15 @@ +#/usr/bin/env bash + +APP="$1" + +echo "Checking out $APP" + +git clone "https://github.com/Nilstrieb/$APP.git" ../app +cd ../app + +CURRENT_COMMIT=$(git rev-parse HEAD | cut -c1-8) +echo "Latest commit of $APP is $CURRENT_COMMIT" + +IMAGE_FULL_NAME="docker.nilstrieb.dev/$APP:$CURRENT_COMMIT" +docker build -t "$IMAGE_FULL_NAME" +docker push "$IMAGE_FULL_NAME" \ No newline at end of file