Docker #11
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
name: Docker | |
on: [workflow_dispatch] | |
jobs: | |
docker-job: | |
runs-on: ubuntu-latest | |
container: | |
image: node:20.3-alpine3.17 | |
env: | |
FOO: bar | |
steps: | |
- name: Log Node & OS versions | |
run: | | |
node -v | |
cat /etc/*-release | |
- name: Log environment variables | |
run: echo "FOO=$FOO" | |
- name: Create a file | |
run: echo "My text" > text.txt | |
- name: Container in a step | |
uses: docker://node:18.20-alpine3.20 | |
with: | |
entrypoint: /usr/local/bin/node | |
args: -p 2+3 | |
- name: Showing the file content | |
uses: docker://node:18.20-alpine3.20 | |
with: | |
entrypoint: cat | |
args: text.txt | |
- uses: actions/checkout@v4 | |
- name: ls -la | |
run: ls -la | |
- name: ls into docker container | |
uses: docker://node:18.20-alpine3.20 | |
with: | |
entrypoint: ls | |
args: "-la" | |
- name: Running a bash script | |
uses: docker://node:18.20-alpine3.20 | |
with: | |
entrypoint: ./example.sh | |
args: "Danico 21" | |
- name: Send a slack message | |
uses: docker://technosophos/slack-notify | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_TITLE: "From GitHub Actions" | |
SLACK_MESSAGE: "⚽️ Actor: ${{ github.actor }}, Event: ${{ github.event_name }}, Repo: ${{ github.repository }}" | |
SLACK_COLOR: "#723fc4" | |
SLACK_USERNAME: "GitHub Actions" |