-
Notifications
You must be signed in to change notification settings - Fork 76
33 lines (33 loc) · 1.08 KB
/
build_coder_image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: build-coder-image
on:
push:
branches:
- "main"
paths:
- ".coder/**" # only run the action when .coder/ folder has been modified
- ".github/workflows/**" # run when a GitHub workflow has been modified
workflow_dispatch:
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get short SHA
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/docs:latest, ${{ secrets.DOCKERHUB_USERNAME }}/docs:${{ steps.vars.outputs.sha_short }}
context: .coder/
file: .coder/Dockerfile
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}