Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 57 additions & 49 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
BEDROCK_SERVER_VERSION: '1.16.220.02'
BEDROCK_SERVER_VERSION: '1.17.11.01'
REPOSITORY: 'bedrock-server'
ORGANIZATION: '5150collective'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -28,56 +25,27 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2


- name: Docker Metadata action
id: metadata
# You may pin to the exact commit or the version.
# uses: docker/metadata-action@f6efe56d565add159ad605568120f5b22712a870
uses: docker/metadata-action@v3.4.0
with:
# List of Docker images to use as base name for tags
images: ${{env.ORGANIZATION}}/${{env.REPOSITORY}}

# Sets up Docker Buildx
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.1.2

- name: Build Docker Image
uses: docker/build-push-action@v2.4.0
with:
# # List of extra privileged entitlement (eg. network.host,security.insecure)
# allow: # optional
# # List of build-time variables
build-args: 'BDS_VERSION=${{ env.BEDROCK_SERVER_VERSION }}'
# # Builder instance
# builder: # optional
# # List of external cache sources for buildx (eg. user/app:cache, type=local,src=path/to/dir)
# cache-from: # optional
# # List of cache export destinations for buildx (eg. user/app:cache, type=local,dest=path/to/dir)
# cache-to: # optional
# # Build's context is the set of files located in the specified PATH or URL
# context: # optional
# # Path to the Dockerfile
# file: # optional
# # List of metadata for an image
# labels: # optional
# # Load is a shorthand for --output=type=docker
build-args: 'BDS_VERSION=${{env.BEDROCK_SERVER_VERSION}}'
labels: ${{steps.metadata.outputs.labels}}
load: true
# # Set the networking mode for the RUN instructions during build
# network: # optional
# # Do not use cache when building the image
# no-cache: # optional, default is false
# # List of output destinations (format: type=local,dest=path)
# outputs: # optional
# # List of target platforms for build
# platforms: # optional
# # Always attempt to pull a newer version of the image
# pull: # optional, default is false
# # Push is a shorthand for --output=type=registry
# push: # optional, default is false
# # List of secrets to expose to the build (eg. key=string, GIT_AUTH_TOKEN=mytoken)
# secrets: # optional
# # List of secret files to expose to the build (eg. key=filename, MY_SECRET=./secret.txt)
# secret-files: # optional
# # List of SSH agent socket or keys to expose to the build
# ssh: # optional
# # List of tags
tags: test:latest,test:local,test:cuzican
# # Sets the target stage to build
# target: # optional
# # GitHub Token used to authenticate against a repository for Git context
# github-token: # optional, default is ${{ github.token }}
tags: local/test:local

- name: Install Goss
# You may pin to the exact commit or the version.
Expand All @@ -88,7 +56,7 @@ jobs:
version: v0.3.9

- name: Test image
run: dgoss run -d --name test -it test:local
run: dgoss run -d --name test -it local/test:local
env:
GOSS_SLEEP: 5
CONTAINER_LOG_OUTPUT: ./goss_test_out.txt
Expand All @@ -99,3 +67,43 @@ jobs:
with:
name: goss-container-log
path: ./goss_test_out.txt

- name: Tag test image
run: |
docker tag local/test:local "$ORGANIZATION/$REPOSITORY:$BEDROCK_SERVER_VERSION"
docker tag local/test:local "$ORGANIZATION/$REPOSITORY:latest"

- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Publish test images
run: |
docker push "$ORGANIZATION/$REPOSITORY:$BEDROCK_SERVER_VERSION"
docker push "$ORGANIZATION/$REPOSITORY:latest"

# Pending docker hub rollout: https://github.com/docker/roadmap/issues/115
# - name: Update Docker Hub Description
# # You may pin to the exact commit or the version.
# # uses: peter-evans/dockerhub-description@616d1b63e806b630b975af3b4fe3304307b20f40
# uses: peter-evans/dockerhub-description@v2.4.3
# with:
# # Docker Hub username
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# # Docker Hub password
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
# # Docker Hub repository in the format `<namespace>/<name>` Default: `github.repository`

# repository: ${{env.ORGANIZATION}}/${{ env.REPOSITORY }}
# # Docker Hub repository short description Input exceeding 100 characters will be truncated

# # short-description: # optional
# # Path to the repository readme Default: `./README.md`

# readme-filepath: ./readme.md


118 changes: 118 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# 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
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
BEDROCK_SERVER_VERSION: '1.17.11.01'
REPOSITORY: 'bedrock-server-dev'
ORGANIZATION: '5150collective'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
'build_and_test_pr':
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2

- name: Docker Metadata action
id: metadata
# You may pin to the exact commit or the version.
# uses: docker/metadata-action@f6efe56d565add159ad605568120f5b22712a870
uses: docker/metadata-action@v3.4.0
with:
# List of Docker images to use as base name for tags
images: ${{env.ORGANIZATION}}/${{env.REPOSITORY}}
# List of tags as key-value pair attributes
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

# Sets up Docker Buildx
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.1.2

- name: Build Docker Image
uses: docker/build-push-action@v2.4.0
with:
build-args: 'BDS_VERSION=${{env.BEDROCK_SERVER_VERSION}}'
labels: ${{steps.metadata.outputs.labels}}
load: true
tags: local/test:local

- name: Install Goss
# You may pin to the exact commit or the version.
# uses: e1himself/goss-installation-action@7f6dff125be808f999d4d5dd29eff9d0c4a02c3d
uses: e1himself/goss-installation-action@v1.0.3
with:
# Goss release version to install
version: v0.3.9

- name: Test image
run: dgoss run -d --name test -it local/test:local
env:
GOSS_SLEEP: 5
CONTAINER_LOG_OUTPUT: ./goss_test_out.txt

- name: Upload goss output
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: goss-container-log
path: ./goss_test_out.txt

- name: Tag test image
run: |
docker tag local/test:local "$ORGANIZATION/$REPOSITORY:$GITHUB_HEAD_REF"

- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Publish test images
run: |
docker push "$ORGANIZATION/$REPOSITORY:$GITHUB_HEAD_REF"

# Pending docker hub rollout: https://github.com/docker/roadmap/issues/115
# - name: Update Docker Hub Description
# # You may pin to the exact commit or the version.
# # uses: peter-evans/dockerhub-description@616d1b63e806b630b975af3b4fe3304307b20f40
# uses: peter-evans/dockerhub-description@v2.4.3
# with:
# # Docker Hub username
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# # Docker Hub password
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
# # Docker Hub repository in the format `<namespace>/<name>` Default: `github.repository`

# repository: ${{env.ORGANIZATION}}/${{ env.REPOSITORY }}
# # Docker Hub repository short description Input exceeding 100 characters will be truncated

# # short-description: # optional
# # Path to the repository readme Default: `./README.md`

# readme-filepath: ./readme.md


4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This Docker image will download the Bedrock Server app and set it up, along with
-p 19132:19132/udp\
--restart=unless-stopped\
-it\
docker.home.ashkinaziy.net/prod/bedrock-server
5150collective/bedrock-server
```

Bind mounts:
Expand All @@ -32,7 +32,7 @@ This Docker image will download the Bedrock Server app and set it up, along with
-p 19132:19132/udp\
--restart=unless-stopped\
-it\
docker.home.ashkinaziy.net/prod/bedrock-server
5150collective/bedrock-server
```
3. Prepare the config files
1. Either start the server once and stop it
Expand Down