Skip to content

Update Dockerfile

Update Dockerfile #26

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
tags:
- v*
pull_request:
branches: [ main ]
release:
types: [ published ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: prep
if: "startsWith(github.ref, 'refs/tags/v')"
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/tags/v}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v3
with:
context: .
tags: ghcr.io/connectbot/jenkins-agent:${{ steps.prep.outputs.tag || 'latest' }}
push: ${{ github.event_name != 'pull_request' }}