Create archive #51
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: [push, pull_request] | |
jobs: | |
clean-up: | |
name: Clean up | |
runs-on: self-hosted | |
steps: | |
- name: Clean up | |
run: rm -rf * | |
# create carla-prerequisites image | |
create-carla-prerequisites-image: | |
name: Create carla-prerequisites image | |
runs-on: self-hosted | |
needs: clean-up | |
steps: | |
- uses: docker/build-push-action@v5 | |
name: Build image | |
with: | |
file: Util/Docker/Prerequisites.Dockerfile | |
tags: carla-prerequisites | |
no-cache: true | |
build-args: | | |
EPIC_USER=${{ secrets.EPIC_USER }} | |
EPIC_PASS=${{ secrets.EPIC_PASS }} | |
# create and push carla-source image | |
create-carla-source-image: | |
name: Create carla-source image | |
runs-on: self-hosted | |
needs: create-carla-prerequisites-image | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout | |
- uses: docker/login-action@v3 | |
name: Login to Docker Hub | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/build-push-action@v5 | |
name: Build and push image | |
with: | |
file: Util/Docker/Carla.Dockerfile | |
tags: cgellerac/carla-source | |
no-cache: true | |
push: true | |
context: . | |
# provide artifacts and releases | |
provide-artifacts: | |
name: Provide carla artifacts | |
runs-on: self-hosted | |
needs: create-carla-source-image | |
steps: | |
# provide carla-package | |
- uses: shrink/actions-docker-extract@v3 | |
name: Extract carla-package | |
with: | |
image: cgellerac/carla-source | |
path: home/carla/carla/Dist | |
destination: artifacts/ | |
# provide carla-python-api | |
- uses: shrink/actions-docker-extract@v3 | |
name: Extract carla-python-api | |
id: extract_python_api | |
with: | |
image: cgellerac/carla-source | |
path: home/carla/carla/PythonAPI | |
destination: artifacts/ | |
# create archive for release | |
- name: Create archive | |
if: startsWith(github.ref, 'refs/tags') | |
run: tar -czvf artifacts/PythonAPI.tar.gz artifacts/PythonAPI | |
# provide release | |
- uses: ncipollo/release-action@v1 | |
name: Create Release | |
if: startsWith(github.ref, 'refs/tags') | |
with: | |
allowUpdates: true | |
tag: ${{ github.ref_name }} | |
commit: ${{ github.sha }} | |
artifacts: artifacts/PythonAPI.tar.gz | |
token: ${{ secrets.PAT }} | |
# create and push carla image | |
create-carla-image: | |
name: Create carla image | |
runs-on: self-hosted | |
needs: provide-artifacts | |
steps: | |
- uses: docker/login-action@v3 | |
name: Login to Docker Hub | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract artifact | |
run: mkdir build && tar -xvzf artifacts/Dist/*.tar.gz -C build | |
- uses: docker/build-push-action@v5 | |
name: Build and push | |
with: | |
file: build/Dockerfile | |
tags: cgellerac/carla | |
no-cache: true | |
context: build | |
push: true |