Skip to content

Commit 3484da2

Browse files
authored
Merge pull request #88 from linuxserver/template-gha
Replace Travis with GHA
2 parents ca3be57 + afcc5a1 commit 3484da2

File tree

3 files changed

+31
-36
lines changed

3 files changed

+31
-36
lines changed

.github/workflows/BuildImage.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Image
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
env:
8+
DOCKERHUB: "linuxserver/mods" #don't modify
9+
BASEIMAGE: "baseimagename" #replace
10+
MODNAME: "modname" #replace
11+
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/[email protected]
15+
16+
- name: Build image
17+
id: build
18+
run: |
19+
docker build --no-cache -t ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${{ github.sha }} .
20+
21+
- name: Push image
22+
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) }}
23+
run: |
24+
# Tag image
25+
docker tag ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${{ github.sha }} ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}
26+
# Login to DockerHub
27+
echo ${{ secrets.DOCKERPASS }} | docker login -u ${{ secrets.DOCKERUSER }} --password-stdin
28+
# Push all of the tags
29+
docker push ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
30+
docker push ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ If adding multiple mods, enter them in an array separated by `|`, such as `DOCKE
1212
* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done.
1313
* Inspect the `root` folder contents. Edit, add and remove as necessary.
1414
* Edit this readme with pertinent info, delete these instructions.
15-
* Finally edit the `travis.yml`. Customize the build branch, and the vars for `BASEIMAGE` and `MODNAME`.
15+
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the build branch, and the vars for `BASEIMAGE` and `MODNAME`.
1616
* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch.
1717
* Submit PR against the branch created by the team.

0 commit comments

Comments
 (0)