generated from LCAS/ros2_pkg_template
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added github action to push image and some other fixes
- Loading branch information
1 parent
ab0cf5f
commit c8215bb
Showing
2 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,14 @@ on: | |
push: | ||
branches: | ||
- main | ||
|
||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build_devcontainer: | ||
runs-on: ubuntu-latest | ||
# only run for LCAS repositories | ||
if: github.repository_owner == 'LCAS' || github.repository_owner == 'lcas' | ||
runs-on: lcas | ||
strategy: | ||
matrix: | ||
config: | ||
|
@@ -23,11 +27,36 @@ jobs: | |
- name: "image name from repo name" | ||
id: docker_image_name | ||
run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT} | ||
- name: Build and run dev container task | ||
|
||
- name: Docker Login LCAS | ||
# don't attempt to login for PRs | ||
if: ${{ github.event_name != 'pull_request' }} | ||
# You may pin to the exact commit or the version. | ||
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
uses: docker/login-action@v2 | ||
with: | ||
# Server address of Docker registry. If not set then will default to Docker Hub | ||
registry: lcas.lincoln.ac.uk | ||
# Username used to log against the Docker registry | ||
username: ${{ secrets.LCAS_REGISTRY_PUSHER }} | ||
# Password or personal access token used to log against the Docker registry | ||
password: ${{ secrets.LCAS_REGISTRY_TOKEN }} | ||
|
||
- name: Build dev container task | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }} | ||
configFile: ./.devcontainer/${{ matrix.config }}/devcontainer.json | ||
push: never | ||
imageTag: ${{ matrix.config }}-${{ env.BRANCH }} | ||
#runCmd: "bash .devcontainer/run-ci.sh" | ||
- name: Build and push dev container image | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }} | ||
configFile: ./.devcontainer/${{ matrix.config }}/devcontainer.json | ||
push: always | ||
imageTag: ${{ matrix.config }}-${{ env.BRANCH }} | ||
#runCmd: "bash .devcontainer/run-ci.sh" |