This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
/
index.html
177 lines (166 loc) · 11.5 KB
/
index.html
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="apple-touch-icon" sizes="57x57" href="/dist/images/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/dist/images/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/dist/images/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/dist/images/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/dist/images/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/dist/images/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/dist/images/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/dist/images/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/dist/images/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/dist/images/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/dist/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/dist/images/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/dist/images/favicon-16x16.png">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/dist/images/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
html, body, nav, footer, .body {
background: #111;
}
</style>
<link rel="stylesheet" rel="async" href="/dist/ctti.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script type="text/javascript" defer src="/dist/bundle.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-53667430-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-53667430-1');
</script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css"/>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
<title>Daniel Canetti • GitHub Actions Hackathon - Getting started</title>
<meta name="description" content="Part 1 - The action I'm building will allow users to create a new, blank Eleventy site including all the files and directories I usually use/create when creating a new site.">
<meta property="og:locale" content="en_GB" />
<meta property="og:site_name" content="Daniel Canetti" />
<meta property="og:title" content="Daniel Canetti • GitHub Actions Hackathon - Getting started" />
<meta property="og:description" content="Part 1 - The action I'm building will allow users to create a new, blank Eleventy site including all the files and directories I usually use/create when creating a new site." />
<meta property="og:url" content="https://danielcanetti.com/blog/github-actions-hackathon/getting-started/" />
<meta property="og:image" content="https://danielcanetti.com/dist/images/githubactions@2x.jpg" />
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:title" content="Daniel Canetti • GitHub Actions Hackathon - Getting started">
<meta property="twitter:description" content="Part 1 - The action I'm building will allow users to create a new, blank Eleventy site including all the files and directories I usually use/create when creating a new site.">
<meta property="twitter:image" content="https://danielcanetti.com/dist/images/githubactions@2x.jpg">
<meta property="twitter:url" content="https://danielcanetti.com/blog/github-actions-hackathon/getting-started/">
<meta property="twitter:site" content="@Dan_Canetti">
<meta property="twitter:creator" content="@Dan_Canetti">
</head>
<body class="sub post">
<div id="wrapper" class="wrapper night">
<nav>
<a class="logo" href="/">Dan's Blog.</a>
<ul>
<li><a class="l" href="/work/">Work</a></li>
<li><a class="l" href="/blog/">Blog</a></li>
<li class="hom"><a class="l" href="/contact/">Contact</a></li>
<li>
<div class="njs-toggle-menu">
<input type="checkbox" id="njs-toggle-menu--toggle" class="njs-toggle-menu--toggle" />
<label for="njs-toggle-menu--toggle">
<span class="toggle-menu__toggle-menu-icon">
<span class="toggle-menu-icon__toggle-menu-icon-inner" aria-label="More menu options - awesome websites"></span>
</span>
</label>
<div class="main-nav">
<ul>
<li><a class="l" href="/work/">Work</a></li>
<li><a class="l" href="/blog/">Blog</a></li>
<li><a class="l" href="/contact/">Contact</a></li>
<li><a class="l" href="/awesome-sites/">Inspiration</a></li>
</ul>
</div>
</div>
</li>
</ul>
</nav>
<img class="post--bg-image" src="/dist/images/githubactions@2x.jpg" />
<div id="post" class="body dark post">
<div class="body__section body__section--post">
<h1>GitHub Actions Hackathon - Getting started</h1>
<div class="body__section--post-meta">
<span>August 18, 2020</span>
<span class="body__section--post-tag">Hackathon</span>
<span class="reading-time"></span>
</div>
<p>Despite using GitHub almost every day I've no real experience with GitHub actions, but this year I'm trying use each of the Dev hackathons to expand my skills and understanding of new technologies.</p>
<p>I decided once again to base this around Eleventy as it's a tool I'm using a lot at the moment and I love giving back and contributing to this community where I can.</p>
<h2>The Action</h2>
<p>The action I'm building will allow users to create a new, blank Eleventy site including all the files and directories I usually use/create when creating a new site:</p>
<ul>
<li><code>.eleventyignore</code> to ignore the <code>README.md</code> file and <code>_assets</code> directory.</li>
<li><code>.eleventy.js</code> to change the build dir to <code>docs</code> for GitHub pages.</li>
<li><code>.gitignore</code> - it'll get used eventually!</li>
<li><code>README.md</code></li>
<li>An <code>_assets</code> directory for design files</li>
<li>A <code>partials</code> directory for Sass partial files (these are then compiled into the <code>_site/docs</code> directory.</li>
</ul>
<h2>First steps</h2>
<p>I had a look at the <a href="https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow">documentation</a> and created a pretty basic workflow file using the template provided. I then set about creating the new site with a series of simple <code>npm</code> and <code>linux</code> commands.</p>
<p>All looked good - let's run it and see what happens.</p>
<h3>Attempt One</h3>
<p><strong>ERROR</strong> - <code>mkdir: missing operand</code>.</p>
<p>Well, that was to be expected. Easy fix, I just removed the <code>mkdir</code> part of the script - we don't actually <em>need</em> this anyway as we need the <code>docs</code> directory we're creating to be in the root of the branch.</p>
<h3>Attempt Two</h3>
<p><strong>ERROR</strong> - Process completed with exit code 128.</p>
<p>This one was a little more complicated. I'd tried to run git commands to add the new site to the repo - but it needed to validate who the user is (obviously). I did some research and came across an <a href="https://github.com/marketplace/actions/add-commit">existing action</a> that can help here.</p>
<p>I added this to my workflow, hardcoded my details for now, and ran the action again.</p>
<h3>Attempt Three</h3>
<p><strong>SUCCESS</strong> 🎉🎉</p>
<p>No errors thrown on this run... but when I check the repo, there's been no files created or added. More work needed.</p>
<hr>
<h3>More in this series</h3>
<div class="toc">
<ul>
<li class="toc__this"><a href="#">Getting Started</a>
<li><a href="/blog/github-actions-hackathon/further-progress/">Further Progress</a>
<li><a href="/blog/github-actions-hackathon/working-on-the-bash/">Working on the bash</a>
<li><a href="/blog/github-actions-hackathon/npm/">NPM</a>
<li><a href="/blog/github-actions-hackathon/create-eleventy-site-action/">Published GitHub Action</a>
</ul>
</div>
<hr>
<div class="share__blog">
<h3>Share: GitHub Actions Hackathon - Getting started</h3>
<div class="share__blog__links">
<a class="l" href="https://www.facebook.com/sharer/sharer.php?u=https://danielcanetti.com/blog/github-actions-hackathon/getting-started/" target="_blank">
Share on Facebook
</a>
<!--a class="l" href="https://www.theguardian.com/technology/2020/jun/01/facebook-workers-rebel-mark-zuckerberg-donald-trump" target="_blank" rel="nofollow">
Don't share on Facebook
</a-->
<a class="l" href="https://twitter.com/intent/tweet?text=GitHub Actions Hackathon - Getting started%20by%20@Dan_Canetti%20-%20https://danielcanetti.com/blog/github-actions-hackathon/getting-started/" target="_blank">
Share on Twitter
</a>
<a class="l" href="https://www.buymeacoffee.com/dancanetti" target="_blank">
Buy me a Coffee
</a>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="footer__content">
<span class="copyright">
Daniel Canetti © 2020<br>
Built with <a class="l" href="https://www.11ty.dev/" target="_blank" rel="noopener" aria-label="Go to Eleventy">Eleventy</a>, <a class="l" href="https://webpack.js.org/" target="_blank" rel="noopener" aria-label="Go to Webpack">Webpack</a>, <a class="l" href="https://www.netlify.com/" target="_blank" rel="noopener" aria-label="Go to Netlify">Netlify</a>, and Coffee. <a class="l" href="/changelog/">View changelog</a>.
</span>
<div class="footer__content__slinks">
<a class="sl" href="https://github.com/DanCanetti" target="_blank" rel="noopener" aria-label="Go to Github"><img src="/dist/images/github.svg" alt="GitHub" /></a>
<a class="sl" href="https://twitter.com/Dan_Canetti" target="_blank" rel="noopener" aria-label="Go to Twitter"><img src="/dist/images/twitter.svg" alt="Twitter" /></a>
<a class="sl" href="https://www.youtube.com/c/DanielCanetti/" target="_blank" rel="noopener" aria-label="Go to YouTube"><img src="/dist/images/youtube.svg" alt="Youtube" /></a>
<a class="sl" href="https://www.twitch.tv/dan_canetti" target="_blank" rel="noopener" aria-label="Go to Twitch"><img src="/dist/images/twitch.svg" alt="Twitch" /></a>
<a class="sl" href="https://www.instagram.com/dan_canetti_dev/" target="_blank" rel="noopener" aria-label="Go to Instagram"><img src="/dist/images/instagram.svg" alt="Instagram" /></a>
</div>
</div>
</footer>
</body>
</html>